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

Unified Diff: base/allocator/allocator_shim.cc

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_shim.cc
diff --git a/base/allocator/allocator_shim.cc b/base/allocator/allocator_shim.cc
index bad8fc6e281e2789841ae9edb6a844f9bc1df946..a680cd5f750c00a62a67a2e8a2953c5f1401a616 100644
--- a/base/allocator/allocator_shim.cc
+++ b/base/allocator/allocator_shim.cc
@@ -90,6 +90,10 @@ inline const allocator::AllocatorDispatch* GetChainHead() {
namespace base {
namespace allocator {
+#if defined(OS_MACOSX)
+bool g_is_mac_shim_layer_initialized = false;
+#endif
+
void SetCallNewHandlerOnMallocFailure(bool value) {
g_call_new_handler_on_malloc_failure = value;
}
@@ -305,6 +309,8 @@ void InitializeAllocatorShim() {
// This replaces the default malloc zone, causing calls to malloc & friends
// from the codebase to be routed to ShimMalloc() above.
OverrideMacSymbols();
+
+ g_is_mac_shim_layer_initialized = true;
}
} // namespace allocator
} // namespace base

Powered by Google App Engine
This is Rietveld 408576698