diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2019-10-24 15:13:48 +0100 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2019-10-24 15:13:48 +0100 |
commit | eee2bd1a8fa61761b5c55cc9c3f09b1ac1052a39 (patch) | |
tree | c2a22cc1a991bd29fbc13cac17a412c751e2e5e1 /libstdc++-v3 | |
parent | 83b5dbb8d906c1ea5a7edcf7a38ec30c02314a95 (diff) | |
download | gcc-eee2bd1a8fa61761b5c55cc9c3f09b1ac1052a39.zip gcc-eee2bd1a8fa61761b5c55cc9c3f09b1ac1052a39.tar.gz gcc-eee2bd1a8fa61761b5c55cc9c3f09b1ac1052a39.tar.bz2 |
PR libstdc++/92143 adjust for OS X aligned_alloc behaviour
OS X 10.15 adds aligned_alloc but it has the same restriction as the AIX
version, namely that alignments smaller than sizeof(void*) are not
supported.
Backport from mainline
2019-10-18 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/92143
* libsupc++/new_opa.cc (operator new) [__APPLE__]: Increase alignment
to at least sizeof(void*).
From-SVN: r277400
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 7 | ||||
-rw-r--r-- | libstdc++-v3/libsupc++/new_opa.cc | 5 |
2 files changed, 10 insertions, 2 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 21d501b..49044ed 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,6 +1,13 @@ 2019-10-24 Jonathan Wakely <jwakely@redhat.com> Backport from mainline + 2019-10-18 Jonathan Wakely <jwakely@redhat.com> + + PR libstdc++/92143 + * libsupc++/new_opa.cc (operator new) [__APPLE__]: Increase alignment + to at least sizeof(void*). + + Backport from mainline 2019-10-08 Jonathan Wakely <jwakely@redhat.com> * doc/Makefile.am (doc-html-docbook-regenerate): New target. diff --git a/libstdc++-v3/libsupc++/new_opa.cc b/libstdc++-v3/libsupc++/new_opa.cc index 68eac5b..64b9ccb 100644 --- a/libstdc++-v3/libsupc++/new_opa.cc +++ b/libstdc++-v3/libsupc++/new_opa.cc @@ -114,9 +114,10 @@ operator new (std::size_t sz, std::align_val_t al) sz = 1; #if _GLIBCXX_HAVE_ALIGNED_ALLOC -# ifdef _AIX +# if defined _AIX || defined __APPLE__ /* AIX 7.2.0.0 aligned_alloc incorrectly has posix_memalign's requirement - * that alignment is a multiple of sizeof(void*). */ + * that alignment is a multiple of sizeof(void*). + * OS X 10.15 has the same requirement. */ if (align < sizeof(void*)) align = sizeof(void*); # endif |