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

Unified Diff: content/app/content_main_runner.cc

Issue 10411047: Type profiler by intercepting 'new' and 'delete' expressions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: reflected maruel's comment. Ready for review. Created 8 years, 4 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: content/app/content_main_runner.cc
diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc
index 4d76ab1f5170d86e479d12bfb8e9bd007a88ab05..8bb941a8e677581abab593b9835e23fdfa44750f 100644
--- a/content/app/content_main_runner.cc
+++ b/content/app/content_main_runner.cc
@@ -48,6 +48,9 @@
#if defined(USE_TCMALLOC)
#include "third_party/tcmalloc/chromium/src/gperftools/malloc_extension.h"
+#if defined(PROFILING_ALLOCATED_TYPE)
+#include "base/allocator/allocated_type_profiler_tcmalloc.h"
+#endif
#endif
#if defined(OS_WIN)
@@ -447,6 +450,14 @@ static void ReleaseFreeMemoryThunk() {
// implement this EnableTerminationOnOutOfMemory() function. Whateverz.
// This works for now.
#if !defined(OS_MACOSX) && defined(USE_TCMALLOC)
+
+#if defined(PROFILING_ALLOCATED_TYPE)
+ base::allocated_type::SetNewInterceptFunction(
jar (doing other things) 2012/08/23 19:55:25 nit: Do you ever set these separately? IF you alwa
Dai Mikurube (NOT FULLTIME) 2012/08/24 02:47:27 Done. I kept individual functions since I often u
jar (doing other things) 2012/08/27 17:17:12 It was not clear which of these should be set firs
Dai Mikurube (NOT FULLTIME) 2012/08/27 23:52:56 Ok, I'll remove individual functions. When I need
Dai Mikurube (NOT FULLTIME) 2012/08/28 09:04:57 Done.
+ base::allocated_type::NewInterceptForTCMalloc);
+ base::allocated_type::SetDeleteInterceptFunction(
+ base::allocated_type::DeleteInterceptForTCMalloc);
+#endif
+
// For tcmalloc, we need to tell it to behave like new.
tc_set_new_mode(1);

Powered by Google App Engine
This is Rietveld 408576698