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

Unified Diff: content/app/content_main_runner.cc

Issue 10825250: Expose memory allocator internal stats and properties. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 58dc14b2bc0dc7e8f8df1a49d545598071899aee..c44cc000d4e538e13521dc41fbf4d52d730feebb 100644
--- a/content/app/content_main_runner.cc
+++ b/content/app/content_main_runner.cc
@@ -413,6 +413,10 @@ class ContentMainRunnerImpl : public ContentMainRunner {
}
#if defined(USE_TCMALLOC)
+static bool GetPropertyThunk(const char* name, size_t* value) {
+ return MallocExtension::instance()->GetNumericProperty(name, value);
+}
+
static void GetStatsThunk(char* buffer, int buffer_length) {
MallocExtension::instance()->GetStats(buffer, buffer_length);
}
@@ -451,6 +455,7 @@ static void ReleaseFreeMemoryThunk() {
tc_set_new_mode(1);
// On windows, we've already set these thunks up in _heap_init()
+ base::allocator::SetGetPropertyFunction(GetPropertyThunk);
base::allocator::SetGetStatsFunction(GetStatsThunk);
base::allocator::SetReleaseFreeMemoryFunction(ReleaseFreeMemoryThunk);
« base/allocator/allocator_extension_thunks.cc ('K') | « base/allocator/allocator_shim.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698