34-posix_memalign.patch 876 B

1234567891011121314
  1. diff --git a/include/__memory/aligned_alloc.h b/include/__memory/aligned_alloc.h
  2. index 786963c..bdcd508 100644
  3. --- a/include/__memory/aligned_alloc.h
  4. +++ b/include/__memory/aligned_alloc.h
  5. @@ -31,7 +31,8 @@ inline _LIBCPP_HIDE_FROM_ABI
  6. void* __libcpp_aligned_alloc(std::size_t __alignment, std::size_t __size) {
  7. # if defined(_LIBCPP_MSVCRT_LIKE)
  8. return ::_aligned_malloc(__size, __alignment);
  9. -# elif _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_C11_ALIGNED_ALLOC)
  10. +// Use posix_memalign instead of ::aligned_alloc to fix the musl and some of the tests
  11. +# elif _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_C11_ALIGNED_ALLOC) && false
  12. // aligned_alloc() requires that __size is a multiple of __alignment,
  13. // but for C++ [new.delete.general], only states "if the value of an
  14. // alignment argument passed to any of these functions is not a valid