Skip to content

Conversation

@PoiXP
Copy link

@PoiXP PoiXP commented Nov 6, 2025

…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:

I've chosen _LIBCPP_HAS_NO_ALIGNED_ALLOCATION to cover more versions.

Closes: #1678

…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.
@PoiXP PoiXP marked this pull request as ready for review November 6, 2025 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ASIO_HAS_STD_ALIGNED_ALLOC not defined on Linux with clang

1 participant