Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(371)

Unified Diff: base/process/memory_win.cc

Issue 2674253003: Populate allocation size into OOM exception on Windows. (Closed)
Patch Set: Address Will's comment. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/process/memory_unittest.cc ('k') | components/crash/content/app/run_as_crashpad_handler_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process/memory_win.cc
diff --git a/base/process/memory_win.cc b/base/process/memory_win.cc
index d433020debb6dabe70e85a430d62bd191d4bbdd0..88244febfb4dd9aeda9287b927c48d6f62d5d221 100644
--- a/base/process/memory_win.cc
+++ b/base/process/memory_win.cc
@@ -35,8 +35,11 @@ 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
- ::RaiseException(win::kOomExceptionCode, EXCEPTION_NONCONTINUABLE, 0,
- nullptr);
+ // Pass the size of the failed request in an exception argument.
+ ULONG_PTR exception_args[] = {size};
+ ::RaiseException(win::kOomExceptionCode, EXCEPTION_NONCONTINUABLE,
+ arraysize(exception_args), exception_args);
+
// Safety check, make sure process exits here.
_exit(win::kOomExceptionCode);
return 0;
« no previous file with comments | « base/process/memory_unittest.cc ('k') | components/crash/content/app/run_as_crashpad_handler_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698