Index: content/app/content_main_runner.cc |
diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc |
index aabe6a311be2ac8d26a7dd4f6334cbff8e195a26..98b6dd8f8be41feb0d53589414d5125f1c6c67e0 100644 |
--- a/content/app/content_main_runner.cc |
+++ b/content/app/content_main_runner.cc |
@@ -49,6 +49,10 @@ |
#if defined(USE_TCMALLOC) |
#include "third_party/tcmalloc/chromium/src/gperftools/malloc_extension.h" |
+#if defined(TYPE_PROFILING) |
+#include "base/allocator/type_profiler.h" |
+#include "base/allocator/type_profiler_tcmalloc.h" |
+#endif |
#endif |
#if defined(OS_WIN) |
@@ -503,13 +507,20 @@ static void ReleaseFreeMemoryThunk() { |
const char** argv, |
ContentMainDelegate* delegate) OVERRIDE { |
- // NOTE(willchan): One might ask why this call is done here rather than in |
- // process_util_linux.cc with the definition of |
+ // NOTE(willchan): One might ask why these TCMalloc-related calls are done |
+ // here rather than in process_util_linux.cc with the definition of |
// EnableTerminationOnOutOfMemory(). That's because base shouldn't have a |
// dependency on TCMalloc. Really, we ought to have our allocator shim code |
// implement this EnableTerminationOnOutOfMemory() function. Whateverz. |
// This works for now. |
#if !defined(OS_MACOSX) && defined(USE_TCMALLOC) |
+ |
+#if defined(TYPE_PROFILING) |
+ base::type_profiler::InterceptFunctions::SetFunctions( |
+ base::type_profiler::NewInterceptForTCMalloc, |
+ base::type_profiler::DeleteInterceptForTCMalloc); |
+#endif |
+ |
// For tcmalloc, we need to tell it to behave like new. |
tc_set_new_mode(1); |