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

Unified Diff: content/app/content_main_runner.cc

Issue 55333002: Make possible to check memory allocations inside chromium (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix component and windows build Created 6 years, 11 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 f59f1774e4136e1843855410e782bc3c6c62752d..b64c498ec5818b170fdbcfdb6bea64cd53601cab 100644
--- a/content/app/content_main_runner.cc
+++ b/content/app/content_main_runner.cc
@@ -54,6 +54,7 @@
#if defined(USE_TCMALLOC)
#include "third_party/tcmalloc/chromium/src/gperftools/malloc_extension.h"
+#include "third_party/tcmalloc/chromium/src/gperftools/tcmalloc.h"
#if defined(TYPE_PROFILING)
#include "base/allocator/type_profiler.h"
#include "base/allocator/type_profiler_tcmalloc.h"
@@ -95,12 +96,6 @@
#endif // OS_POSIX
-#if !defined(OS_MACOSX) && defined(USE_TCMALLOC)
willchan no longer on Chromium 2014/01/16 01:30:05 Thanks for the cleanup.
-extern "C" {
-int tc_set_new_mode(int mode);
-}
-#endif
-
namespace content {
extern int GpuMain(const content::MainFunctionParams&);
#if defined(ENABLE_PLUGINS)
@@ -572,6 +567,8 @@ class ContentMainRunnerImpl : public ContentMainRunner {
// For tcmalloc, we need to tell it to behave like new.
tc_set_new_mode(1);
+ base::SetTCMallocSkipNewHandlerFunction(&tc_malloc_skip_new_handler);
+
// On windows, we've already set these thunks up in _heap_init()
base::allocator::SetGetAllocatorWasteSizeFunction(
GetAllocatorWasteSizeThunk);

Powered by Google App Engine
This is Rietveld 408576698