Index: base/process/memory_win.cc |
diff --git a/base/process/memory_win.cc b/base/process/memory_win.cc |
index 17d588aab739be0d9e9419f1bb757e7c01e3dfa6..864527798261eef3398a61ced6c98ab9a7b4d399 100644 |
--- a/base/process/memory_win.cc |
+++ b/base/process/memory_win.cc |
@@ -7,8 +7,7 @@ |
#include <new.h> |
#include <psapi.h> |
#include <stddef.h> |
- |
-#include "base/logging.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, |
@@ -35,10 +34,12 @@ namespace { |
int OnNoMemory(size_t size) { |
// Kill the process. This is important for security since most of code |
// does not check the result of memory allocation. |
- LOG(FATAL) << "Out of memory, size = " << size; |
+ // 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; |
} |