From 56c9cd41319f4ff4c5a087b28c84bc68c5ffd3f0 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 18 Sep 2026 13:43:20 -0700 Subject: [PATCH] tst_Parser: don't hardcode the page size in all architectures It is fixed to 4096 bytes on x86, but on others it might be different. For them, ask the runtime what the actual size is. Fixes #324. Signed-off-by: Thiago Macieira --- tests/parser/tst_parser.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/parser/tst_parser.cpp b/tests/parser/tst_parser.cpp index f9374583..93ca26be 100644 --- a/tests/parser/tst_parser.cpp +++ b/tests/parser/tst_parser.cpp @@ -157,7 +157,11 @@ struct ParserWrapper uint8_t *allocateMemory(size_t); void freeMemory(); +#if defined(Q_PROCESSOR_X86) static const size_t PageSize = 4096; +#else + static inline const size_t PageSize = getpagesize(); +#endif static inline size_t mmapAllocation(size_t n) { // round up and add one page