blob: a0f84000c2d4597a9982f65723f1c7af51c8eae5 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
diff --git a/include/__memory/aligned_alloc.h b/include/__memory/aligned_alloc.h
index 786963c..bdcd508 100644
--- a/include/__memory/aligned_alloc.h
+++ b/include/__memory/aligned_alloc.h
@@ -31,7 +31,8 @@ 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)
+// Use posix_memalign instead of ::aligned_alloc to fix the musl and some of the tests
+# elif _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_C11_ALIGNED_ALLOC) && false
// aligned_alloc() requires that __size is a multiple of __alignment,
// but for C++ [new.delete.general], only states "if the value of an
// alignment argument passed to any of these functions is not a valid
|