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

Unified Diff: base/process/memory.cc

Issue 1039043002: Add base::TerminateBecauseOutOfMemory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fri Mar 27 10:36:24 PDT 2015 Created 5 years, 9 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.h ('k') | content/child/child_discardable_shared_memory_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process/memory.cc
diff --git a/base/process/memory.cc b/base/process/memory.cc
index 8542dc582e641104b69146e2070e2e64c4123ed6..133a72a0f75a56e2890eb5b9cb7c71aac8597e9e 100644
--- a/base/process/memory.cc
+++ b/base/process/memory.cc
@@ -2,10 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/debug/alias.h"
+#include "base/logging.h"
#include "base/process/memory.h"
namespace base {
+namespace {
+
+// Breakpad server classifies base::`anonymous namespace'::OnNoMemory as
+// out-of-memory crash.
+NOINLINE void OnNoMemory(size_t size) {
+ size_t tmp_size = size;
+ base::debug::Alias(&tmp_size);
+ LOG(FATAL) << "Out of memory. size=" << tmp_size;
+}
+
+} // namespace
+
+void TerminateBecauseOutOfMemory(size_t size) {
+ OnNoMemory(size);
+}
+
// Defined in memory_mac.mm for Mac.
#if !defined(OS_MACOSX)
« no previous file with comments | « base/process/memory.h ('k') | content/child/child_discardable_shared_memory_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698