mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 00:33:09 +00:00
Use fallback implementation for C++ aligned_alloc
fixes https://github.com/official-stockfish/Stockfish/issues/2921 closes https://github.com/official-stockfish/Stockfish/pull/2927 No functional change
This commit is contained in:
parent
add890a10b
commit
d7a26899a9
2 changed files with 6 additions and 6 deletions
|
@ -354,8 +354,8 @@ endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(KERNEL),Darwin)
|
ifeq ($(KERNEL),Darwin)
|
||||||
CXXFLAGS += -arch $(arch) -mmacosx-version-min=10.15
|
CXXFLAGS += -arch $(arch) -mmacosx-version-min=10.13
|
||||||
LDFLAGS += -arch $(arch) -mmacosx-version-min=10.15
|
LDFLAGS += -arch $(arch) -mmacosx-version-min=10.13
|
||||||
endif
|
endif
|
||||||
|
|
||||||
### Travis CI script uses COMPILER to overwrite CXX
|
### Travis CI script uses COMPILER to overwrite CXX
|
||||||
|
|
|
@ -321,9 +321,9 @@ void prefetch(void* addr) {
|
||||||
///
|
///
|
||||||
|
|
||||||
void* std_aligned_alloc(size_t alignment, size_t size) {
|
void* std_aligned_alloc(size_t alignment, size_t size) {
|
||||||
#if defined(__APPLE__)
|
#if (defined(__APPLE__) && defined(_LIBCPP_HAS_C11_FEATURES)) || defined(__ANDROID__) || defined(__OpenBSD__) || (defined(__GLIBCXX__) && !defined(_GLIBCXX_HAVE_ALIGNED_ALLOC) )
|
||||||
return aligned_alloc(alignment, size);
|
return aligned_alloc(alignment, size);
|
||||||
#elif defined(_WIN32)
|
#elif (defined(_WIN32) || (defined(__APPLE__) && !defined(_LIBCPP_HAS_C11_FEATURES)))
|
||||||
return _mm_malloc(size, alignment);
|
return _mm_malloc(size, alignment);
|
||||||
#else
|
#else
|
||||||
return std::aligned_alloc(alignment, size);
|
return std::aligned_alloc(alignment, size);
|
||||||
|
@ -331,9 +331,9 @@ void* std_aligned_alloc(size_t alignment, size_t size) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void std_aligned_free(void* ptr) {
|
void std_aligned_free(void* ptr) {
|
||||||
#if defined(__APPLE__)
|
#if (defined(__APPLE__) && defined(_LIBCPP_HAS_C11_FEATURES)) || defined(__ANDROID__) || defined(__OpenBSD__) || (defined(__GLIBCXX__) && !defined(_GLIBCXX_HAVE_ALIGNED_ALLOC) )
|
||||||
free(ptr);
|
free(ptr);
|
||||||
#elif defined(_WIN32)
|
#elif (defined(_WIN32) || (defined(__APPLE__) && !defined(_LIBCPP_HAS_C11_FEATURES)))
|
||||||
_mm_free(ptr);
|
_mm_free(ptr);
|
||||||
#else
|
#else
|
||||||
free(ptr);
|
free(ptr);
|
||||||
|
|
Loading…
Add table
Reference in a new issue