Index: base/process/memory_win.cc |
diff --git a/base/process/memory_win.cc b/base/process/memory_win.cc |
index 406145aff9de578e2605e080ed09fedc11d77a2c..9d75efecacb21af8e9afbb857a1b560fa6c3f171 100644 |
--- a/base/process/memory_win.cc |
+++ b/base/process/memory_win.cc |
@@ -7,9 +7,7 @@ |
#include <new.h> |
#include <psapi.h> |
#include <stddef.h> |
- |
-#include "base/logging.h" |
-#include "base/strings/safe_sprintf.h" |
+#include <windows.h> |
// malloc_unchecked is required to implement UncheckedMalloc properly. |
// It's provided by allocator_shim_win.cc but since that's not always present, |
@@ -34,19 +32,13 @@ namespace { |
#pragma warning(disable: 4702) |
int OnNoMemory(size_t size) { |
- // Make no additional allocations here to avoid getting into a death spiral |
- // when trying to log the error message. |
- char buf[64]; |
- strings::ssize_t result = |
- strings::SafeSPrintf(buf, "Out of memory, size = %d\n", size); |
- RAW_CHECK(result != -1); |
- |
// Kill the process. This is important for security since most of code |
// does not check the result of memory allocation. |
- RAW_LOG(FATAL, buf); |
- |
+ // https://msdn.microsoft.com/en-us/library/het71c37.aspx |
+ ::RaiseException(win::kOomExceptionCode, EXCEPTION_NONCONTINUABLE, 0, |
+ nullptr); |
// Safety check, make sure process exits here. |
- _exit(1); |
+ _exit(win::kOomExceptionCode); |
return 0; |
} |