Index: base/process/memory_win.cc |
diff --git a/base/process/memory_win.cc b/base/process/memory_win.cc |
index 9d75efecacb21af8e9afbb857a1b560fa6c3f171..d433020debb6dabe70e85a430d62bd191d4bbdd0 100644 |
--- a/base/process/memory_win.cc |
+++ b/base/process/memory_win.cc |
@@ -29,9 +29,9 @@ namespace base { |
namespace { |
#pragma warning(push) |
-#pragma warning(disable: 4702) |
+#pragma warning(disable: 4702) // Unreachable code after the _exit. |
-int OnNoMemory(size_t size) { |
+NOINLINE 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. |
// https://msdn.microsoft.com/en-us/library/het71c37.aspx |
@@ -44,11 +44,12 @@ int OnNoMemory(size_t size) { |
#pragma warning(pop) |
-// HeapSetInformation function pointer. |
-typedef BOOL (WINAPI* HeapSetFn)(HANDLE, HEAP_INFORMATION_CLASS, PVOID, SIZE_T); |
- |
} // namespace |
+void TerminateBecauseOutOfMemory(size_t size) { |
+ OnNoMemory(size); |
+} |
+ |
void EnableTerminationOnHeapCorruption() { |
// Ignore the result code. Supported on XP SP3 and Vista. |
HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0); |