Consider the following (C11) code:
void *ptr = aligned_alloc(4096, 4096); ... // do something with 'ptr' ptr = realloc(ptr, 6000);
Since the memory pointed to by ptr has a 4096 byte alignment from aligned_alloc , will it (read: this is guaranteed) keep that alignment after a (successful) call until realloc ? Or will memory revert to default alignment?
source share