Index: src/platform-win32.cc |
diff --git a/src/platform-win32.cc b/src/platform-win32.cc |
index 68c393884b060c7da68b4a8e8788d05d950bcdb5..fdd4eb082abd9cb29b4db326a2b453a463c018e0 100644 |
--- a/src/platform-win32.cc |
+++ b/src/platform-win32.cc |
@@ -1504,6 +1504,17 @@ 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; |
} |