summaryrefslogtreecommitdiff
path: root/mmap-perf
diff options
context:
space:
mode:
authorKalesh Singh <kaleshsingh@google.com>2023-08-09 13:20:58 -0700
committerKalesh Singh <kaleshsingh@google.com>2023-08-09 13:22:23 -0700
commitfc01862b23effa03a33e6b9faae3762d0853009e (patch)
treef73e8c2f60d28384761b9b10daa03e5967b85bd6 /mmap-perf
parentbd015a64bd3d6e2e40a55637d34c02790674e555 (diff)
downloadextras-fc01862b23effa03a33e6b9faae3762d0853009e.tar.gz
mmap-perf: Remove use of hardcoded PAGE_SIZE 4096
bionic hard codes the PAGE_SIZE macro as 4096. This is going away as Android begins to support larger page sizes. Remove the usage of this assumption from mmap-perf source; use instead getpagesize() which provides the real pagesize. Test: mma Bug: 295082487 Change-Id: I64255a8f3d8725a3635ed3e5a49832ec84fa91fd Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
Diffstat (limited to 'mmap-perf')
-rw-r--r--mmap-perf/mmapPerf.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/mmap-perf/mmapPerf.cpp b/mmap-perf/mmapPerf.cpp
index d7627e28..e0f60529 100644
--- a/mmap-perf/mmapPerf.cpp
+++ b/mmap-perf/mmapPerf.cpp
@@ -14,7 +14,7 @@
#include <sys/mman.h>
using namespace std;
-static const size_t pageSize = PAGE_SIZE;
+static const size_t pageSize = getpagesize();
static size_t fsize = 1024 * (1ull << 20);
static size_t pagesTotal = fsize / pageSize;