| Index: base/process/memory_mac.mm
|
| diff --git a/base/process/memory_mac.mm b/base/process/memory_mac.mm
|
| index 0f0414bb4b009f2c87ab6c3d49fcb4caeeb86d9a..4d719f8054e69398f1f40da51f26f4d7b9ca11b3 100644
|
| --- a/base/process/memory_mac.mm
|
| +++ b/base/process/memory_mac.mm
|
| @@ -131,7 +131,7 @@ void* oom_killer_malloc(struct _malloc_zone_t* zone,
|
| size_t size) {
|
| void* result = g_old_malloc(zone, size);
|
| if (!result && size)
|
| - debug::BreakDebugger();
|
| + TerminateBecauseOutOfMemory(size);
|
| return result;
|
| }
|
|
|
| @@ -140,7 +140,7 @@ void* oom_killer_calloc(struct _malloc_zone_t* zone,
|
| size_t size) {
|
| void* result = g_old_calloc(zone, num_items, size);
|
| if (!result && num_items && size)
|
| - debug::BreakDebugger();
|
| + TerminateBecauseOutOfMemory(num_items * size);
|
| return result;
|
| }
|
|
|
| @@ -148,7 +148,7 @@ void* oom_killer_valloc(struct _malloc_zone_t* zone,
|
| size_t size) {
|
| void* result = g_old_valloc(zone, size);
|
| if (!result && size)
|
| - debug::BreakDebugger();
|
| + TerminateBecauseOutOfMemory(size);
|
| return result;
|
| }
|
|
|
| @@ -162,7 +162,7 @@ void* oom_killer_realloc(struct _malloc_zone_t* zone,
|
| size_t size) {
|
| void* result = g_old_realloc(zone, ptr, size);
|
| if (!result && size)
|
| - debug::BreakDebugger();
|
| + TerminateBecauseOutOfMemory(size);
|
| return result;
|
| }
|
|
|
| @@ -175,7 +175,7 @@ void* oom_killer_memalign(struct _malloc_zone_t* zone,
|
| // http://opensource.apple.com/source/Libc/Libc-583/gen/malloc.c ).
|
| if (!result && size && alignment >= sizeof(void*) &&
|
| (alignment & (alignment - 1)) == 0) {
|
| - debug::BreakDebugger();
|
| + TerminateBecauseOutOfMemory(size);
|
| }
|
| return result;
|
| }
|
| @@ -184,7 +184,7 @@ void* oom_killer_malloc_purgeable(struct _malloc_zone_t* zone,
|
| size_t size) {
|
| void* result = g_old_malloc_purgeable(zone, size);
|
| if (!result && size)
|
| - debug::BreakDebugger();
|
| + TerminateBecauseOutOfMemory(size);
|
| return result;
|
| }
|
|
|
| @@ -193,7 +193,7 @@ void* oom_killer_calloc_purgeable(struct _malloc_zone_t* zone,
|
| size_t size) {
|
| void* result = g_old_calloc_purgeable(zone, num_items, size);
|
| if (!result && num_items && size)
|
| - debug::BreakDebugger();
|
| + TerminateBecauseOutOfMemory(num_items * size);
|
| return result;
|
| }
|
|
|
| @@ -201,7 +201,7 @@ void* oom_killer_valloc_purgeable(struct _malloc_zone_t* zone,
|
| size_t size) {
|
| void* result = g_old_valloc_purgeable(zone, size);
|
| if (!result && size)
|
| - debug::BreakDebugger();
|
| + TerminateBecauseOutOfMemory(size);
|
| return result;
|
| }
|
|
|
| @@ -215,7 +215,7 @@ void* oom_killer_realloc_purgeable(struct _malloc_zone_t* zone,
|
| size_t size) {
|
| void* result = g_old_realloc_purgeable(zone, ptr, size);
|
| if (!result && size)
|
| - debug::BreakDebugger();
|
| + TerminateBecauseOutOfMemory(size);
|
| return result;
|
| }
|
|
|
| @@ -228,7 +228,7 @@ void* oom_killer_memalign_purgeable(struct _malloc_zone_t* zone,
|
| // http://opensource.apple.com/source/Libc/Libc-583/gen/malloc.c ).
|
| if (!result && size && alignment >= sizeof(void*)
|
| && (alignment & (alignment - 1)) == 0) {
|
| - debug::BreakDebugger();
|
| + TerminateBecauseOutOfMemory(size);
|
| }
|
| return result;
|
| }
|
| @@ -238,7 +238,7 @@ void* oom_killer_memalign_purgeable(struct _malloc_zone_t* zone,
|
| // === C++ operator new ===
|
|
|
| void oom_killer_new() {
|
| - debug::BreakDebugger();
|
| + TerminateBecauseOutOfMemory(0);
|
| }
|
|
|
| #if !defined(ADDRESS_SANITIZER)
|
| @@ -277,7 +277,7 @@ void* oom_killer_cfallocator_system_default(CFIndex alloc_size,
|
| void* info) {
|
| void* result = g_old_cfallocator_system_default(alloc_size, hint, info);
|
| if (!result)
|
| - debug::BreakDebugger();
|
| + TerminateBecauseOutOfMemory(alloc_size);
|
| return result;
|
| }
|
|
|
| @@ -286,7 +286,7 @@ void* oom_killer_cfallocator_malloc(CFIndex alloc_size,
|
| void* info) {
|
| void* result = g_old_cfallocator_malloc(alloc_size, hint, info);
|
| if (!result)
|
| - debug::BreakDebugger();
|
| + TerminateBecauseOutOfMemory(alloc_size);
|
| return result;
|
| }
|
|
|
| @@ -295,7 +295,7 @@ void* oom_killer_cfallocator_malloc_zone(CFIndex alloc_size,
|
| void* info) {
|
| void* result = g_old_cfallocator_malloc_zone(alloc_size, hint, info);
|
| if (!result)
|
| - debug::BreakDebugger();
|
| + TerminateBecauseOutOfMemory(alloc_size);
|
| return result;
|
| }
|
|
|
| @@ -310,7 +310,7 @@ id oom_killer_allocWithZone(id self, SEL _cmd, NSZone* zone)
|
| {
|
| id result = g_old_allocWithZone(self, _cmd, zone);
|
| if (!result)
|
| - debug::BreakDebugger();
|
| + TerminateBecauseOutOfMemory(0);
|
| return result;
|
| }
|
|
|
|
|