diff options
author | avi@google.com <avi@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-21 00:23:33 +0000 |
---|---|---|
committer | avi@google.com <avi@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-21 00:23:33 +0000 |
commit | 2620113a74f0bb1502005cbd993e4e6e8555f09f (patch) | |
tree | 639cecd18b9262e14f5960e49e00492878e2b0b1 /base/process_util_mac.mm | |
parent | db262992779c3b3eb3afeba6380776e39c7d4aa0 (diff) | |
download | chromium_src-2620113a74f0bb1502005cbd993e4e6e8555f09f.zip chromium_src-2620113a74f0bb1502005cbd993e4e6e8555f09f.tar.gz chromium_src-2620113a74f0bb1502005cbd993e4e6e8555f09f.tar.bz2 |
Don't use logging from the OOM killers; it allocates memory.
BUG=none
TEST=watch crash logs; the OOM killer functions should never be called from another OOM killer function.
Review URL: http://codereview.chromium.org/411006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32717 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/process_util_mac.mm')
-rw-r--r-- | base/process_util_mac.mm | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/base/process_util_mac.mm b/base/process_util_mac.mm index 073e705..91944e8 100644 --- a/base/process_util_mac.mm +++ b/base/process_util_mac.mm @@ -18,6 +18,7 @@ #include <string> +#include "base/debug_util.h" #include "base/eintr_wrapper.h" #include "base/logging.h" #include "base/string_util.h" @@ -261,8 +262,8 @@ realloc_type g_old_realloc; void* oom_killer_malloc(struct _malloc_zone_t* zone, size_t size) { void* result = g_old_malloc(zone, size); - if (size) - CHECK(result) << "Out of memory, size = " << size; + if (size && !result) + DebugUtil::BreakDebugger(); return result; } @@ -270,17 +271,16 @@ void* oom_killer_calloc(struct _malloc_zone_t* zone, size_t num_items, size_t size) { void* result = g_old_calloc(zone, num_items, size); - if (size) - CHECK(result) << "Out of memory, num_items = " << num_items - << ", size = " << size; + if (num_items && size && !result) + DebugUtil::BreakDebugger(); return result; } void* oom_killer_valloc(struct _malloc_zone_t* zone, size_t size) { void* result = g_old_valloc(zone, size); - if (size) - CHECK(result) << "Out of memory, size = " << size; + if (size && !result) + DebugUtil::BreakDebugger(); return result; } @@ -288,8 +288,8 @@ void* oom_killer_realloc(struct _malloc_zone_t* zone, void* ptr, size_t size) { void* result = g_old_realloc(zone, ptr, size); - if (size) - CHECK(result) << "Out of memory, size = " << size; + if (size && !result) + DebugUtil::BreakDebugger(); return result; } |