Index: base/allocator/allocator_interception_mac.mm |
diff --git a/base/allocator/allocator_interception_mac.mm b/base/allocator/allocator_interception_mac.mm |
index be6c0fa4e9e7261012d2af6525d31fbee9986343..e945a293beb58fbe36e9e4f2c17f1525293b28cc 100644 |
--- a/base/allocator/allocator_interception_mac.mm |
+++ b/base/allocator/allocator_interception_mac.mm |
@@ -27,6 +27,8 @@ |
#include <new> |
+#include "base/allocator/allocator_shim.h" |
+#include "base/allocator/features.h" |
#include "base/logging.h" |
#include "base/mac/mac_util.h" |
#include "base/mac/mach_logging.h" |
@@ -38,12 +40,13 @@ |
namespace base { |
namespace allocator { |
+bool g_replaced_default_zone = false; |
+ |
MallocZoneFunctions::MallocZoneFunctions() {} |
namespace { |
bool g_oom_killer_enabled; |
-bool g_replaced_default_zone = false; |
// Starting with Mac OS X 10.7, the zone allocators set up by the system are |
// read-only, to prevent them from being overwritten in an attack. However, |
@@ -203,12 +206,6 @@ void* oom_killer_memalign_purgeable(struct _malloc_zone_t* zone, |
#endif // !defined(ADDRESS_SANITIZER) |
-// === C++ operator new === |
- |
-void oom_killer_new() { |
- TerminateBecauseOutOfMemory(0); |
-} |
- |
#if !defined(ADDRESS_SANITIZER) |
// === Core Foundation CFAllocators === |
@@ -441,13 +438,6 @@ void InterceptAllocationsMac() { |
// system's malloc implementation. It's unlikely that anyone's even heard of |
// it. |
- // === C++ operator new === |
- |
- // Yes, operator new does call through to malloc, but this will catch failures |
- // that our imperfect handling of malloc cannot. |
- |
- std::set_new_handler(oom_killer_new); |
- |
#ifndef ADDRESS_SANITIZER |
// === Core Foundation CFAllocators === |