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

Unified Diff: runtime/vm/virtual_memory_android.cc

Issue 644453003: Simplify VirtualMemory by removing unused ReserveAligned method. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 2 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
Index: runtime/vm/virtual_memory_android.cc
===================================================================
--- runtime/vm/virtual_memory_android.cc (revision 41000)
+++ runtime/vm/virtual_memory_android.cc (working copy)
@@ -28,7 +28,7 @@
}
-VirtualMemory* VirtualMemory::Reserve(intptr_t size) {
+VirtualMemory* VirtualMemory::ReserveInternal(intptr_t size) {
// TODO(4408): use ashmem instead of anonymous memory.
void* address = mmap(NULL, size, PROT_NONE,
MAP_PRIVATE | MAP_ANON | MAP_NORESERVE,
@@ -37,7 +37,7 @@
return NULL;
}
MemoryRegion region(address, size);
- return new VirtualMemory(region, NULL);
+ return new VirtualMemory(region);
}
@@ -53,12 +53,13 @@
VirtualMemory::~VirtualMemory() {
- unmap(address(), size());
+ unmap(address(), reserved_size_);
}
void VirtualMemory::FreeSubSegment(void* address, intptr_t size) {
unmap(address, size);
+ return true;
}

Powered by Google App Engine
This is Rietveld 408576698