diff --git a/src/runtime/mem_windows.go b/src/runtime/mem_windows.go index 50fca95b4f..71be0e66f0 100644 --- a/src/runtime/mem_windows.go +++ b/src/runtime/mem_windows.go @@ -58,9 +58,8 @@ func sysUnused(v unsafe.Pointer, n uintptr) { func sysUsed(v unsafe.Pointer, n uintptr) { r := stdcall4(_VirtualAlloc, uintptr(v), n, _MEM_COMMIT, _PAGE_READWRITE) - if r != uintptr(v) { - print("runtime: VirtualAlloc of ", n, " bytes failed with errno=", getlasterror(), "\n") - throw("runtime: failed to commit pages") + if r == uintptr(v) { + return } // Commit failed. See SysUnused.