Index: src/platform-win32.cc |
diff --git a/src/platform-win32.cc b/src/platform-win32.cc |
index da2b741dc36cd9e1472070ed0b537da498d8eb82..f4097f708d26499d98e38e4b8164526b500628a3 100644 |
--- a/src/platform-win32.cc |
+++ b/src/platform-win32.cc |
@@ -1518,7 +1518,7 @@ VirtualMemory::VirtualMemory(size_t size, size_t alignment) |
VirtualMemory::~VirtualMemory() { |
if (IsReserved()) { |
- bool result = ReleaseRegion(address_, size_); |
+ bool result = ReleaseRegion(address(), size()); |
ASSERT(result); |
USE(result); |
} |
@@ -1551,6 +1551,17 @@ bool VirtualMemory::Uncommit(void* address, size_t size) { |
} |
+bool VirtualMemory::Guard(void* address) { |
+ if (NULL == VirtualAlloc(address, |
+ OS::CommitPageSize(), |
+ MEM_COMMIT, |
+ PAGE_READONLY | PAGE_GUARD)) { |
+ return false; |
+ } |
+ return true; |
+} |
+ |
+ |
void* VirtualMemory::ReserveRegion(size_t size) { |
return RandomizedVirtualAlloc(size, MEM_RESERVE, PAGE_NOACCESS); |
} |
@@ -1567,17 +1578,6 @@ bool VirtualMemory::CommitRegion(void* base, size_t size, bool is_executable) { |
} |
-bool VirtualMemory::Guard(void* address) { |
- if (NULL == VirtualAlloc(address, |
- OS::CommitPageSize(), |
- MEM_COMMIT, |
- PAGE_READONLY | PAGE_GUARD)) { |
- return false; |
- } |
- return true; |
-} |
- |
- |
bool VirtualMemory::UncommitRegion(void* base, size_t size) { |
return VirtualFree(base, size, MEM_DECOMMIT) != 0; |
} |