Disable aligned new/delete on Apple platforms without posix_memalign

Summary:
This patch disables the aligned new/delet overloads on Apple platforms without `posix_memalign`. This fixes libc++.dylib build regressions on such platforms.
This fixes http://llvm.org/PR31448.

This patch should also be merged into the 4.0 release branch


Reviewers: mclow.lists, rsmith, dexonsmith, jeremyhu

Reviewed By: mclow.lists

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D28931

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292564 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2017-01-20 01:47:26 +00:00
parent e28ff33405
commit d54d974f1f
3 changed files with 19 additions and 2 deletions

View File

@@ -151,6 +151,8 @@ operator delete[] (void* ptr, size_t) _NOEXCEPT
::operator delete[](ptr);
}
#if !defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION)
_LIBCPP_WEAK
void *
operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC
@@ -275,6 +277,8 @@ operator delete[] (void* ptr, size_t, std::align_val_t alignment) _NOEXCEPT
::operator delete[](ptr, alignment);
}
#endif // !defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION)
#endif // !__GLIBCXX__
namespace std