Page MenuHomePhabricator

Disable aligned new/delete on Apple platforms without posix_memalign
ClosedPublic

Authored by EricWF on Jan 19 2017, 5:16 PM.

Details

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

Diff Detail

Event Timeline

EricWF created this revision.Jan 19 2017, 5:16 PM
EricWF updated this revision to Diff 85072.Jan 19 2017, 5:27 PM
  • Remove NFC parts of this patch and commit them to master.
EricWF updated this revision to Diff 85080.Jan 19 2017, 5:49 PM
  • Remove <Availability.h> include in place of defining the required macros manually.
EricWF updated this revision to Diff 85082.Jan 19 2017, 5:56 PM
  • Move __config block lower down in the file as suggested by Marshall.
mclow.lists accepted this revision.Jan 19 2017, 5:57 PM

LGTM. Thanks!

This revision is now accepted and ready to land.Jan 19 2017, 5:57 PM
EricWF closed this revision.Jan 19 2017, 5:58 PM
rsmith edited edge metadata.Jan 19 2017, 6:23 PM

Does OS X have the C11 aligned_alloc function? Perhaps we could use that instead, when available.

No, the old versions of OS X that lack posix_memalign also lack aligned_alloc.

@rsmith I looked for an alternative provider for aligned allocation but couldn't find one, which is quite unfortunate. Is this going to mess up the __libcpp_version detection Clang does?