[Bug libstdc++/79190] [7 Regression] ld: (Warning) Unsatisfied symbol "aligned_alloc"
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jan 23 16:55:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79190
--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The C++17 draft requires aligned-delete to be used for memory obtained from
aligned-new (and not otherwise):
"Requires: If the alignment parameter is not present, ptr shall have been
returned by an allocation function without an alignment parameter. If present,
the alignment argument shall equal the alignment argument passed to the
allocation function that returned ptr."
So for aligned-new we can over-allocate and return a suitably aligned pointer
within the allocated region, storing a cookie before that pointer that tells us
the address originally obtained from malloc. For aligned-delete we read the
cookie.
More information about the Gcc-bugs
mailing list