Chromium Code Reviews| Index: runtime/vm/virtual_memory_win.cc |
| diff --git a/runtime/vm/virtual_memory_win.cc b/runtime/vm/virtual_memory_win.cc |
| index 25846136a996007789204103b8fc3aba808b33ed..3f17f3da88822a7a8301eec6116afa9cd1592dce 100644 |
| --- a/runtime/vm/virtual_memory_win.cc |
| +++ b/runtime/vm/virtual_memory_win.cc |
| @@ -45,10 +45,10 @@ VirtualMemory::~VirtualMemory() { |
| 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; |
| + if (VirtualFree(address, size, MEM_DECOMMIT) == 0) { |
| + FATAL("VirtualFree failed"); |
|
siva
2016/10/13 16:11:40
might be worthwhile to report the error code here
zra
2016/10/13 16:56:08
Done.
|
| + } |
| + return true; |
| } |