Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(526)

Unified Diff: src/platform-win32.cc

Issue 14162004: Unified the structure of VirtualMemory implementations across platforms a bit. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/platform-solaris.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « src/platform-solaris.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698