8000 ICU-23064 Fix for POSIX_MADV_RANDOM undefined · unicode-org/icu@443c8c5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 443c8c5

Browse files
committed
ICU-23064 Fix for POSIX_MADV_RANDOM undefined
1 parent 53adb4b commit 443c8c5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

icu4c/source/common/umapfile.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,12 @@ typedef HANDLE MemoryMap;
238238
pData->pHeader=(const DataHeader *)data;
239239
pData->mapAddr = data;
240240
#if U_PLATFORM == U_PF_IPHONE || U_PLATFORM == U_PF_ANDROID
241+
// Apparently supported from Android 23 and higher:
242+
// https://github.com/ggml-org/llama.cpp/pull/3631
243+
// Checking for the flag itself is safer than checking for __ANDROID_API__.
244+
# ifdef POSIX_MADV_RANDOM
241245
posix_madvise(data, length, POSIX_MADV_RANDOM);
246+
# endif
242247
#endif
243248
return true;
244249
}

0 commit comments

Comments
 (0)
0