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

Unified Diff: runtime/vm/virtual_memory_win.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
« runtime/vm/virtual_memory.h ('K') | « runtime/vm/virtual_memory_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/virtual_memory_win.cc
===================================================================
--- runtime/vm/virtual_memory_win.cc (revision 41000)
+++ runtime/vm/virtual_memory_win.cc (working copy)
@@ -22,7 +22,7 @@
}
-VirtualMemory* VirtualMemory::Reserve(intptr_t size) {
+VirtualMemory* VirtualMemory::ReserveInternal(intptr_t size) {
void* address = VirtualAlloc(NULL, size, MEM_RESERVE, PAGE_NOACCESS);
if (address == NULL) {
return NULL;
@@ -33,23 +33,20 @@
VirtualMemory::~VirtualMemory() {
- if (size() == 0) {
+ if (reserved_size_ == 0) {
return;
}
-
- // Since sub-segments are not freed, free the entire virtual segment
- // here by passing the originally reserved pointer to VirtualFree.
- ASSERT(reserved_pointer_ != NULL);
- if (VirtualFree(reserved_pointer_, 0, MEM_RELEASE) == 0) {
+ if (VirtualFree(address(), 0, MEM_RELEASE) == 0) {
FATAL("VirtualFree failed");
}
}
-void VirtualMemory::FreeSubSegment(void* address, intptr_t size) {
+bool VirtualMemory::FreeSubSegment(void* address, intptr_t size) {
// On Windows only the entire segment returned by VirtualAlloc
// can be freed. Therefore we will have to waste these unused
// virtual memory sub-segments.
+ return false;
}
« runtime/vm/virtual_memory.h ('K') | « runtime/vm/virtual_memory_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698