Chromium Code Reviews| Index: base/process/memory_mac.mm |
| diff --git a/base/process/memory_mac.mm b/base/process/memory_mac.mm |
| index dd30e704c8ffc0d98ed17b1b0706db625490e324..d81c8e67b94a04dc8c8a2a787c602bb41797e639 100644 |
| --- a/base/process/memory_mac.mm |
| +++ b/base/process/memory_mac.mm |
| @@ -498,6 +498,17 @@ void* UncheckedMalloc(size_t size) { |
| return malloc(size); |
| } |
| +void* UncheckedCalloc(size_t num_items, size_t size) { |
| + if (g_old_calloc) { |
| +#if ARCH_CPU_32_BITS |
| + ScopedClearErrno clear_errno; |
| + ThreadLocalBooleanAutoReset flag(g_unchecked_malloc.Pointer(), true); |
|
Scott Hess - ex-Googler
2013/09/24 21:05:54
This reads confusing - maybe change g_unchecked_ma
mtklein
2013/09/24 21:12:18
You bet. Was thinking that myself. Done.
|
| +#endif // ARCH_CPU_32_BITS |
| + return g_old_calloc(malloc_default_zone(), num_items, size); |
| + } |
| + return calloc(num_items, size); |
| +} |
| + |
| void EnableTerminationOnOutOfMemory() { |
| if (g_oom_killer_enabled) |
| return; |