From 11e932e634cf0a2bd214b9925ad31ecd0e3aba73 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 7 Feb 2013 16:42:55 +0100 Subject: [PATCH] Centralize code to determine system page size Use the existing WTF::pageSize() instead of calling sysconf ourselves. Change-Id: If68c793898253a239e13070e3454653474f61790 Reviewed-by: Lars Knoll --- src/3rdparty/masm/stubs/ExecutableAllocator.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/3rdparty/masm/stubs/ExecutableAllocator.h b/src/3rdparty/masm/stubs/ExecutableAllocator.h index 7b3004a..de04ffe 100644 --- a/src/3rdparty/masm/stubs/ExecutableAllocator.h +++ b/src/3rdparty/masm/stubs/ExecutableAllocator.h @@ -43,6 +43,7 @@ #include #include +#include #include #include @@ -55,7 +56,7 @@ struct ExecutableMemoryHandle : public RefCounted { ExecutableMemoryHandle(int size) : m_size(size) { - static size_t pageSize = sysconf(_SC_PAGESIZE); + size_t pageSize = WTF::pageSize(); m_size = (m_size + pageSize - 1) & ~(pageSize - 1); #if OS(DARWIN) # define MAP_ANONYMOUS MAP_ANON @@ -92,7 +93,7 @@ struct ExecutableAllocator { static void makeExecutable(void* addr, int size) { - static size_t pageSize = sysconf(_SC_PAGESIZE); + size_t pageSize = WTF::pageSize(); size_t iaddr = reinterpret_cast(addr); size_t roundAddr = iaddr & ~(pageSize - static_cast(1)); int mode = PROT_READ | PROT_WRITE | PROT_EXEC; -- 2.7.4