]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR libstdc++/92143 adjust for OS X aligned_alloc behaviour
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 18 Oct 2019 11:27:31 +0000 (11:27 +0000)
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 18 Oct 2019 11:27:31 +0000 (11:27 +0000)
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.

PR libstdc++/92143
* libsupc++/new_opa.cc (operator new) [__APPLE__]: Increase alignment
to at least sizeof(void*).

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@277151 138bc75d-0d04-0410-961f-82ee72b054a4

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

index c37bbd05eb66786bd4e1e2f4f4ac5fa8ead3c338..8f39e66e3e02f78c5aeb9f6b666f566d8aab9161 100644 (file)
@@ -1,5 +1,9 @@
 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*).
+
        * include/bits/range_cmp.h (ranges::less::operator()): Inline the
        logic from std::less::operator() to remove the dependency on it.
 
index aa5d2e144559639173e228bfd3390495375f364d..80eb343a1c80a43df6fff262d476f1fbb290d365 100644 (file)
@@ -108,9 +108,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