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

Unified Diff: third_party/tcmalloc/chromium/src/tcmalloc.cc

Issue 1410353005: Add generic.total_physical_bytes property to MallocExtension (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@web_cache2
Patch Set: Add in readme. Created 5 years, 2 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
« no previous file with comments | « third_party/tcmalloc/chromium/src/gperftools/malloc_extension.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/tcmalloc/chromium/src/tcmalloc.cc
diff --git a/third_party/tcmalloc/chromium/src/tcmalloc.cc b/third_party/tcmalloc/chromium/src/tcmalloc.cc
index c8a705ff501f26bf5cd58eabcdeed049444b755b..4709411718bc9eba3e96af3d4b4cc6ac1233284b 100644
--- a/third_party/tcmalloc/chromium/src/tcmalloc.cc
+++ b/third_party/tcmalloc/chromium/src/tcmalloc.cc
@@ -678,6 +678,14 @@ class TCMallocImplementation : public MallocExtension {
return true;
}
+ if (strcmp(name, "generic.total_physical_bytes") == 0) {
+ TCMallocStats stats;
+ ExtractStats(&stats, NULL, NULL, NULL);
+ *value = stats.pageheap.system_bytes + stats.metadata_bytes -
+ stats.pageheap.unmapped_bytes - stats.metadata_unmapped_bytes;
+ return true;
+ }
+
if (strcmp(name, "tcmalloc.slack_bytes") == 0) {
// Kept for backwards compatibility. Now defined externally as:
// pageheap_free_bytes + pageheap_unmapped_bytes.
« no previous file with comments | « third_party/tcmalloc/chromium/src/gperftools/malloc_extension.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698