It occured to me that when using realloc, you have to reassign the destination pointer... like so...
with return checking of course. you'd need to do this since the returned destination pointer might not be the same address as the sent destination pointer [so you have to reassign it to keep dest_ptr pointing to the same ideal location]...
dest_ptr = (type_cast) realloc (ptr, newsize);
anyway, it dawned on me that memcpy might behave the same way. I wanted to do something like the following...
anyways... in my dirty rectangles video setup, my usage of memcpy seems to be okay in that all the return pointers are still contigious w/ the master pointer's relative location... so, i suppose then that memcpy would never dislocate on me then eh? i could understand if the request was too large, but it would never 'succeed' with a different pointer, right? thanks.
// makeshift example
// allocate a, blah, assume it works... etc
a = calloc (100, 1);
b = a + 25; // b points to the 25th element
c = a + 50; // c points to the 50th element
// if the return pointer from b is not equal to the sent destination pointer, you'd get a mismapping, and you couldn't address from ptr_a correctly
b = memcpy (b, c, 25);
// however if the return ptr from memcpy is the same location, everything works out nicely...