Repository navigation
Backfill <experimental/memory_resource> for Xcode 16 compatibility - #9
Merged
Merged
Conversation
Xcode 16's libc++ removed <experimental/memory_resource>. std::pmr is only available in the macOS system libc++ from macOS 14, it compiles cleanly against an older deployment target and then fails to load on older systems with a missing std::__1::pmr::memory_resource vtable. This implements memory_resource interface and polymorphic_allocator on macOS. Both are header-only, so nothing uses the system C++ library. memory_resource's destructor is defined inline so the class has no Itanium ABI "key function" - its vtable is emitted into every consuming object file rather than being looked up at load time.
tommaisey
approved these changes
Sep 21, 2026
tommaisey
left a comment
Collaborator
There was a problem hiding this comment.
I had hoped to avoid reimplementing this header, but I think macOS's clang/libc++ versions have backed us into a corner. If this works, then I'm ok with it 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Xcode 16's libc++ removed
<experimental/memory_resource>.std::pmris only available in the macOS system libc++ from macOS 14, it compiles cleanly against an older deployment target and then fails to load on older systems with a missingstd::__1::pmr::memory_resourcevtable.This implements
memory_resourceinterface andpolymorphic_allocatoron macOS. Both are header-only, so nothing uses the system C++ library.memory_resource's destructor is defined inline so the class has no Itanium ABI "key function" - its vtable is emitted into every consuming object file rather than being looked up at load time.pmr_shim.h authored by Claude. I've reviewed and all looks reasonable. Unit tests pass on Windows/VS2019 and macOS 15/Xcode 16.4.