[libcxx-commits] [libcxx] [libc++] Improve aligned allocation support with picolibc. (PR #96086)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jun 21 07:14:15 PDT 2024


================
@@ -30,7 +30,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 inline _LIBCPP_HIDE_FROM_ABI void* __libcpp_aligned_alloc(std::size_t __alignment, std::size_t __size) {
 #  if defined(_LIBCPP_MSVCRT_LIKE)
   return ::_aligned_malloc(__size, __alignment);
-#  elif _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_C11_ALIGNED_ALLOC)
+#  elif defined(_LIBCPP_HAS_C11_ALIGNED_ALLOC) || (_LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_C11_ALIGNED_ALLOC))
----------------
ldionne wrote:

Is there a reason for introducing a new macro named `_LIBCPP_HAS_C11_ALIGNED_ALLOC`? It should suffice not to define `_LIBCPP_HAS_NO_C11_ALIGNED_ALLOC` on picolibc, no?

https://github.com/llvm/llvm-project/pull/96086


More information about the libcxx-commits mailing list