aboutsummaryrefslogtreecommitdiffstats
path: root/src/3rdparty
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@digia.com>2014-10-21 17:21:56 +0200
committerUlf Hermann <ulf.hermann@digia.com>2014-10-30 13:19:45 +0100
commit2fb59fe64b75ba1d2c7f0e5d33dc199d8b8ee591 (patch)
tree7f2f111fd654d8dc00baaa108aadcc2aa5d29e78 /src/3rdparty
parent78ac7ecbd4af02e989d3f391cf0f3627f93fd12c (diff)
Remove guard pages option from uncommitted page reservations
It's only implemented for non-linux unix-like systems and it's quite challenging to get it right everywhere else. So, instead of giving the user the illusion that guard pages might be available we just drop them. Change-Id: I7ec74c84f6215f22bd10758728b18bbecc0adf59 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/3rdparty')
-rw-r--r--src/3rdparty/masm/wtf/OSAllocator.h2
-rw-r--r--src/3rdparty/masm/wtf/OSAllocatorPosix.cpp5
-rw-r--r--src/3rdparty/masm/wtf/OSAllocatorWin.cpp2
-rw-r--r--src/3rdparty/masm/wtf/OSAllocatorWinRT.cpp2
-rw-r--r--src/3rdparty/masm/wtf/PageAllocationAligned.cpp2
-rw-r--r--src/3rdparty/masm/wtf/PageReservation.h12
6 files changed, 9 insertions, 16 deletions
diff --git a/src/3rdparty/masm/wtf/OSAllocator.h b/src/3rdparty/masm/wtf/OSAllocator.h
index a12a467497..494f8bc3c7 100644
--- a/src/3rdparty/masm/wtf/OSAllocator.h
+++ b/src/3rdparty/masm/wtf/OSAllocator.h
@@ -45,7 +45,7 @@ public:
// These methods are symmetric; reserveUncommitted allocates VM in an uncommitted state,
// releaseDecommitted should be called on a region of VM allocated by a single reservation,
// the memory must all currently be in a decommitted state.
- static void* reserveUncommitted(size_t, Usage = UnknownUsage, bool writable = true, bool executable = false, bool includesGuardPages = false);
+ static void* reserveUncommitted(size_t, Usage = UnknownUsage, bool writable = true, bool executable = false);
WTF_EXPORT_PRIVATE static void releaseDecommitted(void*, size_t);
// These methods are symmetric; they commit or decommit a region of VM (uncommitted VM should
diff --git a/src/3rdparty/masm/wtf/OSAllocatorPosix.cpp b/src/3rdparty/masm/wtf/OSAllocatorPosix.cpp
index d8c8e0378f..f52c22f7fa 100644
--- a/src/3rdparty/masm/wtf/OSAllocatorPosix.cpp
+++ b/src/3rdparty/masm/wtf/OSAllocatorPosix.cpp
@@ -38,7 +38,7 @@
namespace WTF {
-void* OSAllocator::reserveUncommitted(size_t bytes, Usage usage, bool writable, bool executable, bool includesGuardPages)
+void* OSAllocator::reserveUncommitted(size_t bytes, Usage usage, bool writable, bool executable)
{
#if OS(QNX)
// Reserve memory with PROT_NONE and MAP_LAZY so it isn't committed now.
@@ -49,14 +49,13 @@ void* OSAllocator::reserveUncommitted(size_t bytes, Usage usage, bool writable,
UNUSED_PARAM(usage);
UNUSED_PARAM(writable);
UNUSED_PARAM(executable);
- UNUSED_PARAM(includesGuardPages);
void* result = mmap(0, bytes, PROT_NONE, MAP_NORESERVE | MAP_PRIVATE | MAP_ANON, -1, 0);
if (result == MAP_FAILED)
CRASH();
madvise(result, bytes, MADV_DONTNEED);
#else
- void* result = reserveAndCommit(bytes, usage, writable, executable, includesGuardPages);
+ void* result = reserveAndCommit(bytes, usage, writable, executable);
#if HAVE(MADV_FREE_REUSE)
// To support the "reserve then commit" model, we have to initially decommit.
while (madvise(result, bytes, MADV_FREE_REUSABLE) == -1 && errno == EAGAIN) { }
diff --git a/src/3rdparty/masm/wtf/OSAllocatorWin.cpp b/src/3rdparty/masm/wtf/OSAllocatorWin.cpp
index bcd1f6df04..259fc67324 100644
--- a/src/3rdparty/masm/wtf/OSAllocatorWin.cpp
+++ b/src/3rdparty/masm/wtf/OSAllocatorWin.cpp
@@ -41,7 +41,7 @@ static inline DWORD protection(bool writable, bool executable)
(writable ? PAGE_READWRITE : PAGE_READONLY);
}
-void* OSAllocator::reserveUncommitted(size_t bytes, Usage, bool writable, bool executable, bool)
+void* OSAllocator::reserveUncommitted(size_t bytes, Usage, bool writable, bool executable)
{
void* result = VirtualAlloc(0, bytes, MEM_RESERVE, protection(writable, executable));
if (!result)
diff --git a/src/3rdparty/masm/wtf/OSAllocatorWinRT.cpp b/src/3rdparty/masm/wtf/OSAllocatorWinRT.cpp
index 7ed9f539e5..9b8f5bf46b 100644
--- a/src/3rdparty/masm/wtf/OSAllocatorWinRT.cpp
+++ b/src/3rdparty/masm/wtf/OSAllocatorWinRT.cpp
@@ -33,7 +33,7 @@
namespace WTF {
-void* OSAllocator::reserveUncommitted(size_t bytes, Usage, bool, bool, bool)
+void* OSAllocator::reserveUncommitted(size_t bytes, Usage, bool, bool)
{
void* result = _aligned_malloc(bytes, 16);
if (!result)
diff --git a/src/3rdparty/masm/wtf/PageAllocationAligned.cpp b/src/3rdparty/masm/wtf/PageAllocationAligned.cpp
index 1c35653381..90c2fd61db 100644
--- a/src/3rdparty/masm/wtf/PageAllocationAligned.cpp
+++ b/src/3rdparty/masm/wtf/PageAllocationAligned.cpp
@@ -52,7 +52,7 @@ PageAllocationAligned PageAllocationAligned::allocate(size_t size, size_t alignm
// Resererve with suffcient additional VM to correctly align.
size_t reservationSize = size + alignmentDelta;
- void* reservationBase = OSAllocator::reserveUncommitted(reservationSize, usage, writable, false);
+ void* reservationBase = OSAllocator::reserveUncommitted(reservationSize, usage, writable);
// Select an aligned region within the reservation and commit.
void* alignedBase = reinterpret_cast<uintptr_t>(reservationBase) & alignmentMask
diff --git a/src/3rdparty/masm/wtf/PageReservation.h b/src/3rdparty/masm/wtf/PageReservation.h
index 15be344fa8..74a136168c 100644
--- a/src/3rdparty/masm/wtf/PageReservation.h
+++ b/src/3rdparty/masm/wtf/PageReservation.h
@@ -104,13 +104,7 @@ public:
static PageReservation reserve(size_t size, OSAllocator::Usage usage = OSAllocator::UnknownUsage, bool writable = true, bool executable = false)
{
ASSERT(isPageAligned(size));
- return PageReservation(OSAllocator::reserveUncommitted(size, usage, writable, executable), size, writable, executable, false);
- }
-
- static PageReservation reserveWithGuardPages(size_t size, OSAllocator::Usage usage = OSAllocator::UnknownUsage, bool writable = true, bool executable = false)
- {
- ASSERT(isPageAligned(size));
- return PageReservation(OSAllocator::reserveUncommitted(size + pageSize() * 2, usage, writable, executable, true), size, writable, executable, true);
+ return PageReservation(OSAllocator::reserveUncommitted(size, usage, writable, executable), size, writable, executable);
}
void deallocate()
@@ -129,8 +123,8 @@ public:
}
private:
- PageReservation(void* base, size_t size, bool writable, bool executable, bool hasGuardPages)
- : PageBlock(base, size, hasGuardPages)
+ PageReservation(void* base, size_t size, bool writable, bool executable)
+ : PageBlock(base, size, false)
, m_committed(0)
, m_writable(writable)
, m_executable(executable)