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

Unified Diff: src/platform-macos.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-linux.cc ('k') | src/platform-nullos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform-macos.cc
diff --git a/src/platform-macos.cc b/src/platform-macos.cc
index 898c93f39a346003ae53724cc290df362c12d5ed..8327acfb5f13170d7098233d4ed0aebc596ed157 100644
--- a/src/platform-macos.cc
+++ b/src/platform-macos.cc
@@ -408,12 +408,33 @@ VirtualMemory::~VirtualMemory() {
}
+bool VirtualMemory::IsReserved() {
+ return address_ != NULL;
+}
+
+
void VirtualMemory::Reset() {
address_ = NULL;
size_ = 0;
}
+bool VirtualMemory::Commit(void* address, size_t size, bool is_executable) {
+ return CommitRegion(address, size, is_executable);
+}
+
+
+bool VirtualMemory::Uncommit(void* address, size_t size) {
+ return UncommitRegion(address, size);
+}
+
+
+bool VirtualMemory::Guard(void* address) {
+ OS::Guard(address, OS::CommitPageSize());
+ return true;
+}
+
+
void* VirtualMemory::ReserveRegion(size_t size) {
void* result = mmap(OS::GetRandomMmapAddr(),
size,
@@ -428,22 +449,6 @@ void* VirtualMemory::ReserveRegion(size_t size) {
}
-bool VirtualMemory::IsReserved() {
- return address_ != NULL;
-}
-
-
-bool VirtualMemory::Commit(void* address, size_t size, bool is_executable) {
- return CommitRegion(address, size, is_executable);
-}
-
-
-bool VirtualMemory::Guard(void* address) {
- OS::Guard(address, OS::CommitPageSize());
- return true;
-}
-
-
bool VirtualMemory::CommitRegion(void* address,
size_t size,
bool is_executable) {
@@ -462,11 +467,6 @@ bool VirtualMemory::CommitRegion(void* address,
}
-bool VirtualMemory::Uncommit(void* address, size_t size) {
- return UncommitRegion(address, size);
-}
-
-
bool VirtualMemory::UncommitRegion(void* address, size_t size) {
return mmap(address,
size,
« no previous file with comments | « src/platform-linux.cc ('k') | src/platform-nullos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698