Use !defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION) to determine if lib…#1680
Open
PoiXP wants to merge 1 commit intochriskohlhoff:masterfrom
Open
Use !defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION) to determine if lib…#1680PoiXP wants to merge 1 commit intochriskohlhoff:masterfrom
!defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION) to determine if lib…#1680PoiXP wants to merge 1 commit intochriskohlhoff:masterfrom
Conversation
…c++ supports aligned allocations. The ASIO uses `_LIBCPP_HAS_ALIGNED_ALLOC`` to learn if libc++ defines `std::aligned_new`. I didn't manage to find this define in llvm codebase. I found these though: - [_LIBCPP_HAS_NO_ALIGNED_ALLOCATION](https://github.com/llvm/llvm-project/blob/dbd197118db597970a5a9c5688c5e0bb01948ebb/libcxx/include/__config#L642C13-L642C46) is defined when either library or compiler lack support. I didn't trace when it was introduced [but 2018 version defines it](llvm/llvm-project@53ac177) - [_LIBCPP_HAS_ALIGNED_ALLOCATION](https://github.com/llvm/llvm-project/blob/1c094a1ce2ef15b5855b11aa85dbb2f1eea54f13/libcxx/include/__config#L667-L671) is inverse of `_LIBCPP_HAS_NO_ALIGNED_ALLOCATION`` but only available [since Oct 12,2024](llvm/llvm-project@ba87515#diff-720de38e87ca590a6946574a5c75c382720f1784dd63ba60deb0bb54bd827c43). I've chosen `_LIBCPP_HAS_NO_ALIGNED_ALLOCATION` to cover more versions.
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.
…c++ supports aligned allocations.
The ASIO uses
_LIBCPP_HAS_ALIGNED_ALLOCto learn if libc++ definesstd::aligned_new.I didn't manage to find this define in llvm codebase.
I found these though:
I've chosen
_LIBCPP_HAS_NO_ALIGNED_ALLOCATIONto cover more versions.Closes: #1678