]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR libstdc++/92143 adjust for OS X aligned_alloc behaviour
authorJonathan Wakely <jwakely@redhat.com>
Thu, 24 Oct 2019 15:31:00 +0000 (16:31 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 24 Oct 2019 15:31:00 +0000 (16:31 +0100)
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: r277414

libstdc++-v3/ChangeLog
libstdc++-v3/libsupc++/new_opa.cc

index b51beb4c28eb442105d3af560f7edcb2d0c8837c..1cad1c582412fbab9e2a457f0394a42ca5d993ad 100644 (file)
@@ -1,5 +1,12 @@
 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>
 
index 94e79cadb0e24e51f7231e94870b856d68682a99..d7461227c29da575e64d78145e99a21995bb0f62 100644 (file)
@@ -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