diff --git a/CHANGELOG.md b/CHANGELOG.md index bf82b452..6cf7b029 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## Changelog +## [2.2.3] - 2023-11-02 +### Fixed +- use _mm_malloc/_mm_free on macOS if aligned_alloc is unsupported + ## [2.2.2] - 2023-10-31 ### Fixed - fix compilation failure on macOS diff --git a/CMakeLists.txt b/CMakeLists.txt index 4f4e699e..79edc492 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,7 +32,7 @@ if (CMAKE_BINARY_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) message(FATAL_ERROR "Building in-source is not supported! Create a build dir and remove ${CMAKE_SOURCE_DIR}/CMakeCache.txt") endif() -project(rapidfuzz LANGUAGES CXX VERSION 2.2.2) +project(rapidfuzz LANGUAGES CXX VERSION 2.2.3) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") include(GNUInstallDirs) diff --git a/extras/rapidfuzz_amalgamated.hpp b/extras/rapidfuzz_amalgamated.hpp index 547668e3..ab69ee12 100644 --- a/extras/rapidfuzz_amalgamated.hpp +++ b/extras/rapidfuzz_amalgamated.hpp @@ -1,7 +1,7 @@ // Licensed under the MIT License . // SPDX-License-Identifier: MIT // RapidFuzz v1.0.2 -// Generated: 2023-11-01 00:20:18.570286 +// Generated: 2023-11-02 10:29:38.300883 // ---------------------------------------------------------- // This file is an amalgamation of multiple different files. // You probably shouldn't edit it directly. @@ -1567,6 +1567,10 @@ constexpr void unroll(F&& f) #include +#if defined(__APPLE__) && !defined(_LIBCPP_HAS_C11_FEATURES) +# include +#endif + namespace rapidfuzz::detail { template @@ -1633,6 +1637,8 @@ static inline void* rf_aligned_alloc(size_t alignment, size_t size) { #if defined(_WIN32) return _aligned_malloc(size, alignment); +#elif defined(__APPLE__) && !defined(_LIBCPP_HAS_C11_FEATURES) + return _mm_malloc(size, alignment); #else return aligned_alloc(alignment, size); #endif @@ -1642,6 +1648,8 @@ static inline void rf_aligned_free(void* ptr) { #if defined(_WIN32) _aligned_free(ptr); +#elif defined(__APPLE__) && !defined(_LIBCPP_HAS_C11_FEATURES) + _mm_free(ptr); #else free(ptr); #endif diff --git a/rapidfuzz/details/common.hpp b/rapidfuzz/details/common.hpp index 0e0ad6bc..e6ee1c54 100644 --- a/rapidfuzz/details/common.hpp +++ b/rapidfuzz/details/common.hpp @@ -13,6 +13,10 @@ #include #include +#if defined(__APPLE__) && !defined(_LIBCPP_HAS_C11_FEATURES) +# include +#endif + namespace rapidfuzz::detail { template @@ -79,6 +83,8 @@ static inline void* rf_aligned_alloc(size_t alignment, size_t size) { #if defined(_WIN32) return _aligned_malloc(size, alignment); +#elif defined(__APPLE__) && !defined(_LIBCPP_HAS_C11_FEATURES) + return _mm_malloc(size, alignment); #else return aligned_alloc(alignment, size); #endif @@ -88,6 +94,8 @@ static inline void rf_aligned_free(void* ptr) { #if defined(_WIN32) _aligned_free(ptr); +#elif defined(__APPLE__) && !defined(_LIBCPP_HAS_C11_FEATURES) + _mm_free(ptr); #else free(ptr); #endif