File tree Expand file tree Collapse file tree 6 files changed +8
-29
lines changed Expand file tree Collapse file tree 6 files changed +8
-29
lines changed Original file line number Diff line number Diff line change @@ -567,7 +567,6 @@ set(files
567567 __mdspan/mdspan.h
568568 __memory/addressof.h
569569 __memory/align.h
570- __memory/aligned_alloc.h
571570 __memory/allocate_at_least.h
572571 __memory/allocation_guard.h
573572 __memory/allocator.h
Original file line number Diff line number Diff line change @@ -670,27 +670,6 @@ typedef __char32_t char32_t;
670670# define _LIBCPP_HAS_ALIGNED_ALLOCATION 1
671671# endif
672672
673- // It is not yet possible to use aligned_alloc() on all Apple platforms since
674- // 10.15 was the first version to ship an implementation of aligned_alloc().
675- # if defined(__APPLE__)
676- # if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && \
677- __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101500 ) || \
678- (defined (__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && \
679- __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 130000 ) || \
680- (defined (__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && \
681- __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 60000 ) || \
682- (defined (__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 130000 )
683- # define _LIBCPP_HAS_C11_ALIGNED_ALLOC 0
684- # else
685- # define _LIBCPP_HAS_C11_ALIGNED_ALLOC 1
686- # endif
687- # elif defined(__ANDROID__) && __ANDROID_API__ < 28
688- // Android only provides aligned_alloc when targeting API 28 or higher.
689- # define _LIBCPP_HAS_C11_ALIGNED_ALLOC 0
690- # else
691- # define _LIBCPP_HAS_C11_ALIGNED_ALLOC 1
692- # endif
693-
694673# if defined(__APPLE__) || defined(__FreeBSD__)
695674# define _LIBCPP_WCTYPE_IS_MASK
696675# endif
Original file line number Diff line number Diff line change @@ -1634,7 +1634,6 @@ module std [system] {
16341634 module memory {
16351635 module addressof { header "__memory/addressof.h" }
16361636 module align { header "__memory/align.h" }
1637- module aligned_alloc { header "__memory/aligned_alloc.h" }
16381637 module allocate_at_least { header "__memory/allocate_at_least.h" }
16391638 module allocation_guard { header "__memory/allocation_guard.h" }
16401639 module allocator {
Original file line number Diff line number Diff line change 66//
77// ===----------------------------------------------------------------------===//
88
9- #ifndef _LIBCPP___MEMORY_ALIGNED_ALLOC_H
10- #define _LIBCPP___MEMORY_ALIGNED_ALLOC_H
9+ #ifndef _LIBCPP_SRC_ALIGNED_ALLOC_H
10+ #define _LIBCPP_SRC_ALIGNED_ALLOC_H
1111
1212#include < __config>
1313#include < cstdlib>
@@ -29,7 +29,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2929inline _LIBCPP_HIDE_FROM_ABI void * __libcpp_aligned_alloc (std::size_t __alignment, std::size_t __size) {
3030# if defined(_LIBCPP_MSVCRT_LIKE)
3131 return ::_aligned_malloc (__size, __alignment);
32- # elif _LIBCPP_STD_VER >= 17 && _LIBCPP_HAS_C11_ALIGNED_ALLOC
32+
33+ // Android only provides aligned_alloc when targeting API 28 or higher.
34+ # elif !defined(__ANDROID__) || __ANDROID_API__ >= 28
3335 // aligned_alloc() requires that __size is a multiple of __alignment,
3436 // but for C++ [new.delete.general], only states "if the value of an
3537 // alignment argument passed to any of these functions is not a valid
@@ -60,4 +62,4 @@ inline _LIBCPP_HIDE_FROM_ABI void __libcpp_aligned_free(void* __ptr) {
6062
6163_LIBCPP_END_NAMESPACE_STD
6264
63- #endif // _LIBCPP___MEMORY_ALIGNED_ALLOC_H
65+ #endif // _LIBCPP_SRC_ALIGNED_ALLOC_H
Original file line number Diff line number Diff line change 1616#endif
1717#endif
1818
19- #include < __memory /aligned_alloc.h>
19+ #include " include /aligned_alloc.h" // from libc++
2020#include < __assert>
2121#include < stdlib.h> // for malloc, calloc, free
2222#include < string.h> // for memset
Original file line number Diff line number Diff line change 88
99#include " __cxxabi_config.h"
1010#include " abort_message.h"
11+ #include " include/aligned_alloc.h" // from libc++
1112#include " include/overridable_function.h" // from libc++
12- #include < __memory/aligned_alloc.h>
1313#include < cstddef>
1414#include < cstdlib>
1515#include < new>
You can’t perform that action at this time.
0 commit comments