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

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

Issue 9212025: Support use of third party time function to profiler (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 10 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 | « base/tracked_objects.cc ('k') | third_party/tcmalloc/chromium/src/thread_cache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/tcmalloc/chromium/src/tcmalloc.cc
===================================================================
--- third_party/tcmalloc/chromium/src/tcmalloc.cc (revision 121705)
+++ third_party/tcmalloc/chromium/src/tcmalloc.cc (working copy)
@@ -1130,6 +1130,8 @@
Length num_pages = tcmalloc::pages(size);
size = num_pages << kPageShift;
+ heap->AddToByteAllocatedTotal(size); // Chromium profiling.
+
if ((FLAGS_tcmalloc_sample_parameter > 0) && heap->SampleAllocation(size)) {
result = DoSampledAllocation(size);
@@ -1159,6 +1161,12 @@
size_t cl = Static::sizemap()->SizeClass(size);
size = Static::sizemap()->class_to_size(cl);
+ // TODO(jar): If this has any detectable performance impact, it can be
+ // optimized by only tallying sizes if the profiler was activated to recall
+ // these tallies. I don't think this is performance critical, but we really
+ // should measure it.
+ heap->AddToByteAllocatedTotal(size); // Chromium profiling.
+
if ((FLAGS_tcmalloc_sample_parameter > 0) && heap->SampleAllocation(size)) {
ret = DoSampledAllocation(size);
MarkAllocatedRegion(ret);
« no previous file with comments | « base/tracked_objects.cc ('k') | third_party/tcmalloc/chromium/src/thread_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698