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

Unified Diff: base/process/memory_win.cc

Issue 2674253003: Populate allocation size into OOM exception on Windows. (Closed)
Patch Set: 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
Index: base/process/memory_win.cc
diff --git a/base/process/memory_win.cc b/base/process/memory_win.cc
index d433020debb6dabe70e85a430d62bd191d4bbdd0..3380c7b4bb61eb519f90fde8987b4b9653f5cea9 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
scottmg 2017/02/06 18:17:41 '.' at end of sentence.
Sigurður Ásgeirsson 2017/02/06 19:43:58 Ooops, abortive comment - thanks. Done.
+ 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;

Powered by Google App Engine
This is Rietveld 408576698