File tree Expand file tree Collapse file tree 1 file changed +5
-13
lines changed
include/boost/container/detail Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -32,26 +32,18 @@ namespace dtl {
3232
3333BOOST_CONTAINER_FORCEINLINE bool operator_new_raw_overaligned (std::size_t alignment)
3434{
35+ // In MacOs, the default allocator can return data aligned to 8 bytes
36+ #if defined(__APPLE__)
37+ return alignment > 8u ;
3538 // GCC-clang on Mingw-w64 has problems with malloc (MSVCRT / UCRT) alignment not matching
3639 // __STDCPP_DEFAULT_NEW_ALIGNMENT__, since HeapAlloc alignment is 8 for 32 bit targets
37- #if !defined(__cpp_aligned_new) || (defined(_WIN32) && !defined(_WIN64) && !defined(_MSC_VER))
38- return alignment > 2u *sizeof (void *);
40+ #elif !defined(__cpp_aligned_new) || (defined(_WIN32) && !defined(_WIN64) && !defined(_MSC_VER))
41+ return alignment > 2 *sizeof (void *);
3942 #else
4043 return alignment > __STDCPP_DEFAULT_NEW_ALIGNMENT__;
4144 #endif
4245}
4346
44- BOOST_CONTAINER_FORCEINLINE bool operator_new_raw_overaligned_tricky ()
45- {
46- // GCC-clang on Mingw-w64 has problems with malloc (MSVCRT / UCRT) alignment not matching
47- // __STDCPP_DEFAULT_NEW_ALIGNMENT__, since HeapAlloc alignment is 8 for 32 bit targets
48- #if !defined(__cpp_aligned_new) || (defined(_WIN32) && !defined(_WIN64) && !defined(_MSC_VER))
49- return true ;
50- #else
51- return false ;
52- #endif
53- }
54-
5547BOOST_CONTAINER_FORCEINLINE void * operator_new_raw_allocate (const std::size_t size, const std::size_t alignment)
5648{
5749 (void )alignment;
You can’t perform that action at this time.
0 commit comments