Do not invoke realloc()
to modify the size of allocated storage that has stricter alignment requirements than being those normally provided by malloc()
. The C standard mandates that any pointer returned by malloc()
must be suitably aligned so that it may be assigned to a pointer to any type of object with a fundamental alignment requirement (storage allocated by a call to the C Standard aligned_alloc()
function, for example.)
...