]> git.ipfire.org Git - thirdparty/gcc.git/commit
Add workaround for aligned_alloc bug on AIX
authorJonathan Wakely <jwakely@redhat.com>
Tue, 7 Aug 2018 22:50:15 +0000 (23:50 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 7 Aug 2018 22:50:15 +0000 (23:50 +0100)
commita2d762245d712fda04c73b7f528f4aad3e18a5fd
treeaf0cf411fb069b990af28f72d67eebe45563ac00
parentc9ceac07d74d49d7848f82b253ae978545c17cb9
Add workaround for aligned_alloc bug on AIX

On AIX 7.2.0.0 aligned_alloc incorrectly requires the alignment to be a
multiple of sizeof(void*).

This adds a workaround to the operator new overload taking an alignment
value, to increase the alignment (and size) if needed.

Backport from mainline
2018-07-30  Jonathan Wakely  <jwakely@redhat.com>

* libsupc++/new_opa.cc (operator new(size_t, align_val_t)): Add
workaround for aligned_alloc bug on AIX.
* testsuite/18_support/new_aligned.cc: New test.

From-SVN: r263375
libstdc++-v3/ChangeLog
libstdc++-v3/libsupc++/new_opa.cc
libstdc++-v3/testsuite/18_support/new_aligned.cc [new file with mode: 0644]