summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Chang <vichang@google.com>2024-03-04 16:30:01 +0000
committerVictor Chang <vichang@google.com>2024-04-19 12:16:39 +0100
commit7fcb14e00813b046124361e3f26ac8ac2c168fca (patch)
tree99033152ea5ba0eeac1b390ee2b7a55a3d27776c
parent1215de969174828132d2dd234d180616c6aec21c (diff)
downloadicu-7fcb14e00813b046124361e3f26ac8ac2c168fca.tar.gz
Android patch: madvise when mapping icu (time zone) data files
Bug: 298349312 Test: device boots Change-Id: Ic57b9855b0491fd01dada840b130f09d3f2da0e4
-rw-r--r--icu4c/source/common/umapfile.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/icu4c/source/common/umapfile.cpp b/icu4c/source/common/umapfile.cpp
index 8dddf0e78..554a65cfd 100644
--- a/icu4c/source/common/umapfile.cpp
+++ b/icu4c/source/common/umapfile.cpp
@@ -249,7 +249,8 @@ typedef HANDLE MemoryMap;
pData->map = (char *)data + length;
pData->pHeader=(const DataHeader *)data;
pData->mapAddr = data;
-#if U_PLATFORM == U_PF_IPHONE
+ // Android-changed: madvise on Android for performance reason.
+#if U_PLATFORM == U_PF_IPHONE || U_PLATFORM == U_PF_ANDROID
posix_madvise(data, length, POSIX_MADV_RANDOM);
#endif
return true;