search for: somelength

Displaying 3 results from an estimated 3 matches for "somelength".

2018 Jan 08
0
Why is remalloc not marked as noalias?
...o (or just past) reaches the end of its lifetime" > > Is this enough to infer that we can safely mark realloc as noalias? Realloc is tricky in practice and has caused us to rethink pointer equality on CHERI. We’ve observed that this is a fairly common idiom: char *new = realloc(old, someLength); if (new != old) { // Update some copies of old to use new } This was problematic for us, because old and new had the same address but different bounds information and we were treating comparisons of pointers as equal if they pointed to the same location. This is problematic with noalias, becau...
2017 Dec 26
3
Why is remalloc not marked as noalias?
Hello, According to my understanding, it seems that the result of realloc will not technically alias the original pointer. When the realloc is done in-place the reference <http://en.cppreference.com/w/c/memory/realloc> says: "The original pointer ptr is invalidated and any access to it is undefined behavior (even if reallocation was in-place)." Additionally from the C11 standard
2018 Jan 09
1
Why is remalloc not marked as noalias?
...aches the end of its lifetime" >> >> Is this enough to infer that we can safely mark realloc as noalias? > Realloc is tricky in practice and has caused us to rethink pointer equality on CHERI. We’ve observed that this is a fairly common idiom: > > char *new = realloc(old, someLength); > if (new != old) > { > // Update some copies of old to use new > } > > This was problematic for us, because old and new had the same address but different bounds information and we were treating comparisons of pointers as equal if they pointed to the same location. > > T...