mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 08:24:39 +00:00
[windows] Revert virtual memory changes
Revert changes to virtual_memory_win.cc in case they are the cause of the OOM failures on the debug windows x64 bot. Review URL: https://codereview.chromium.org/2420853002 .
This commit is contained in:
parent
476ffbda5e
commit
4118680345
|
@ -35,20 +35,20 @@ VirtualMemory* VirtualMemory::ReserveInternal(intptr_t size) {
|
|||
|
||||
|
||||
VirtualMemory::~VirtualMemory() {
|
||||
if (embedder_allocated()) {
|
||||
if (embedder_allocated() || (reserved_size_ == 0)) {
|
||||
return;
|
||||
}
|
||||
if (VirtualFree(address(), 0, MEM_RELEASE) == 0) {
|
||||
FATAL1("VirtualFree failed: Error code %d\n", GetLastError());
|
||||
FATAL("VirtualFree failed");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool VirtualMemory::FreeSubSegment(void* address, intptr_t size) {
|
||||
if (VirtualFree(address, size, MEM_DECOMMIT) == 0) {
|
||||
FATAL1("VirtualFree failed: Error code %d\n", GetLastError());
|
||||
}
|
||||
return true;
|
||||
// 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;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue