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

Unified Diff: base/allocator/allocator_interception_mac.mm

Issue 2676093003: mac: Hook up allocator shim during app startup. (Closed)
Patch Set: Comments from primiano. Created 3 years, 10 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
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..c5c34dacaf88c4b9ef95085e28692c00dbce9efd 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"
@@ -448,6 +450,10 @@ void InterceptAllocationsMac() {
std::set_new_handler(oom_killer_new);
Primiano Tucci (use gerrit) 2017/02/07 11:58:08 (read this comment after the one below) Honestly I
erikchen 2017/02/09 23:49:04 Done.
+#if BUILDFLAG(USE_EXPERIMENTAL_ALLOCATOR_SHIM)
+ allocator::SetCallNewHandlerOnMallocFailure(true);
Primiano Tucci (use gerrit) 2017/02/07 11:58:08 why here and not in memory_mac.mm -> EnableTermina
erikchen 2017/02/09 23:49:04 Done.
+#endif
+
#ifndef ADDRESS_SANITIZER
// === Core Foundation CFAllocators ===

Powered by Google App Engine
This is Rietveld 408576698