Skip to content

Commit 505911d

Browse files
committed
use posix_memalign on android
1 parent e5acade commit 505911d

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
### Fixed
1111
- fix incorrect transposition calculation in simd implementation of Jaro similarity
12+
- use posix_memalign on android
1213

1314
## [2.2.3] - 2023-11-02
1415
### Fixed

extras/rapidfuzz_amalgamated.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Licensed under the MIT License <http://opensource.org/licenses/MIT>.
22
// SPDX-License-Identifier: MIT
33
// RapidFuzz v1.0.2
4-
// Generated: 2023-12-25 11:17:08.593362
4+
// Generated: 2023-12-25 15:26:08.006867
55
// ----------------------------------------------------------
66
// This file is an amalgamation of multiple different files.
77
// You probably shouldn't edit it directly.
@@ -1627,6 +1627,9 @@ static inline void* rf_aligned_alloc(size_t alignment, size_t size)
16271627
return _aligned_malloc(size, alignment);
16281628
#elif defined(__APPLE__) && !defined(_LIBCPP_HAS_C11_FEATURES)
16291629
return _mm_malloc(size, alignment);
1630+
#elif defined(__ANDROID__) && __ANDROID_API__ > 16
1631+
void* ptr = nullptr;
1632+
return posix_memalign(&ptr, alignment, size) ? nullptr : ptr;
16301633
#else
16311634
return aligned_alloc(alignment, size);
16321635
#endif

rapidfuzz/details/common.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ static inline void* rf_aligned_alloc(size_t alignment, size_t size)
6666
return _aligned_malloc(size, alignment);
6767
#elif defined(__APPLE__) && !defined(_LIBCPP_HAS_C11_FEATURES)
6868
return _mm_malloc(size, alignment);
69+
#elif defined(__ANDROID__) && __ANDROID_API__ > 16
70+
void* ptr = nullptr;
71+
return posix_memalign(&ptr, alignment, size) ? nullptr : ptr;
6972
#else
7073
return aligned_alloc(alignment, size);
7174
#endif

0 commit comments

Comments
 (0)