diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-02-07 16:42:55 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@digia.com> | 2013-02-09 10:45:59 +0100 |
commit | 11e932e634cf0a2bd214b9925ad31ecd0e3aba73 (patch) | |
tree | 0498955e72eed6fc9373bc72068b7406b48a08cf /src/3rdparty/masm/stubs | |
parent | 285bef0ee925fb3d0554b1e4b9b137a1f7e67455 (diff) |
Centralize code to determine system page size
Use the existing WTF::pageSize() instead of calling sysconf
ourselves.
Change-Id: If68c793898253a239e13070e3454653474f61790
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/3rdparty/masm/stubs')
-rw-r--r-- | src/3rdparty/masm/stubs/ExecutableAllocator.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/3rdparty/masm/stubs/ExecutableAllocator.h b/src/3rdparty/masm/stubs/ExecutableAllocator.h index 7b3004aa90..de04ffe977 100644 --- a/src/3rdparty/masm/stubs/ExecutableAllocator.h +++ b/src/3rdparty/masm/stubs/ExecutableAllocator.h @@ -43,6 +43,7 @@ #include <RefPtr.h> #include <RefCounted.h> +#include <wtf/PageBlock.h> #include <sys/mman.h> #include <unistd.h> @@ -55,7 +56,7 @@ struct ExecutableMemoryHandle : public RefCounted<ExecutableMemoryHandle> { 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<size_t>(addr); size_t roundAddr = iaddr & ~(pageSize - static_cast<size_t>(1)); int mode = PROT_READ | PROT_WRITE | PROT_EXEC; |