Skip to content

Use _LIBCPP_HAS_C11_ALIGNED_ALLOC to gate posix_memalign fallback in aligned_alloc_at_least. - #640

Draft
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_975469931
Draft

Use _LIBCPP_HAS_C11_ALIGNED_ALLOC to gate posix_memalign fallback in aligned_alloc_at_least.#640
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_975469931

Conversation

@copybara-service

Copy link
Copy Markdown

Use _LIBCPP_HAS_C11_ALIGNED_ALLOC to gate posix_memalign fallback in aligned_alloc_at_least.

_ISOC11_SOURCE is a glibc feature test macro undefined in standard C++ builds, inadvertently forcing the posix_memalign fallback. Instead, check _LIBCPP_HAS_C11_ALIGNED_ALLOC to only fall back to posix_memalign when std::aligned_alloc is unavailable.

…aligned_alloc_at_least.

_ISOC11_SOURCE is a glibc feature test macro undefined in standard C++ builds, inadvertently forcing the posix_memalign fallback. Instead, check _LIBCPP_HAS_C11_ALIGNED_ALLOC to only fall back to posix_memalign when std::aligned_alloc is unavailable.

PiperOrigin-RevId: 975469931
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.

1 participant