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

Unified Diff: base/allocator/allocator_shim.cc

Issue 2727463002: mac: Several minor fixes to allocator shim. (Closed)
Patch Set: Treat MallocZoneFunctions as POD. 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 48b13501fe443ddc2062a1fab5e14a43a3a19649..a401139ee652d5043279aa899674aba7b82101b1 100644
--- a/base/allocator/allocator_shim.cc
+++ b/base/allocator/allocator_shim.cc
@@ -23,6 +23,8 @@
#if defined(OS_MACOSX)
#include <malloc/malloc.h>
+
+#include "base/allocator/allocator_interception_mac.h"
#endif
// No calls to malloc / new in this file. They would would cause re-entrancy of
@@ -324,9 +326,11 @@ void InitializeAllocatorShim() {
// traversed the shim this will route them to the default malloc zone.
InitializeDefaultDispatchToMacAllocator();
+ MallocZoneFunctions functions = MallocZoneFunctionsToReplaceDefault();
Primiano Tucci (use gerrit) 2017/03/21 19:39:23 out of curiosity why this doesn't happen in alloca
erikchen 2017/03/24 21:59:03 allocator_shim depends on allocator_shim_default_d
+
// This replaces the default malloc zone, causing calls to malloc & friends
// from the codebase to be routed to ShimMalloc() above.
- OverrideMacSymbols();
+ base::allocator::ReplaceFunctionsForStoredZones(&functions);
}
} // namespace allocator
} // namespace base

Powered by Google App Engine
This is Rietveld 408576698