diff options
author | Ulf Hermann <ulf.hermann@digia.com> | 2014-10-21 16:47:53 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@digia.com> | 2014-10-30 13:19:33 +0100 |
commit | 625dae442419d3f75bcecbafeaca490cdd5413a8 (patch) | |
tree | 260ef75b180794ba4d4f8ed5ec4f18221604834e /src/3rdparty/masm/wtf/PageAllocation.h | |
parent | 970ff81a14c93c4f41f384026220d4baad8eec70 (diff) |
Allow page allocations to include guard pages
The PageAllocator is in principle capable of using guard pages. We can
expose that functionality to its clients.
Change-Id: I919f6f76310feb160d2b26ac1fc64db4e91804bb
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/3rdparty/masm/wtf/PageAllocation.h')
-rw-r--r-- | src/3rdparty/masm/wtf/PageAllocation.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/3rdparty/masm/wtf/PageAllocation.h b/src/3rdparty/masm/wtf/PageAllocation.h index 18d31880c0..95692be3ae 100644 --- a/src/3rdparty/masm/wtf/PageAllocation.h +++ b/src/3rdparty/masm/wtf/PageAllocation.h @@ -87,10 +87,15 @@ public: operator bool() const { return PageBlock::operator bool(); } #endif - static PageAllocation allocate(size_t size, OSAllocator::Usage usage = OSAllocator::UnknownUsage, bool writable = true, bool executable = false) + static PageAllocation allocate(size_t size, + OSAllocator::Usage usage = OSAllocator::UnknownUsage, + bool writable = true, bool executable = false, + bool includesGuardPages = false) { ASSERT(isPageAligned(size)); - return PageAllocation(OSAllocator::reserveAndCommit(size, usage, writable, executable), size); + return PageAllocation(OSAllocator::reserveAndCommit(size, usage, writable, executable, + includesGuardPages), size, + includesGuardPages); } void deallocate() @@ -103,12 +108,12 @@ public: ASSERT(tmp); ASSERT(!*this); - OSAllocator::decommitAndRelease(tmp.base(), tmp.size()); + OSAllocator::decommitAndRelease(tmp.realBase(), tmp.realSize()); } private: - PageAllocation(void* base, size_t size) - : PageBlock(base, size, false) + PageAllocation(void* base, size_t size, bool includesGuardPages = false) + : PageBlock(base, size, includesGuardPages) { } }; |