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

Unified Diff: src/profiler/sampling-heap-profiler.cc

Issue 1828333002: Eliminate zero count allocations from profile (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix signed/unsigned comparison Created 4 years, 8 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 | « no previous file | test/cctest/test-heap-profiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/profiler/sampling-heap-profiler.cc
diff --git a/src/profiler/sampling-heap-profiler.cc b/src/profiler/sampling-heap-profiler.cc
index a32cae3ef9c926c77aa448d614ca7ed2793cbec7..61e4897b31d8e4431f7cbf5500c4bb53970c50f2 100644
--- a/src/profiler/sampling-heap-profiler.cc
+++ b/src/profiler/sampling-heap-profiler.cc
@@ -117,6 +117,9 @@ void SamplingHeapProfiler::OnWeakCallback(
AllocationNode* node = sample->owner;
DCHECK(node->allocations_[sample->size] > 0);
node->allocations_[sample->size]--;
+ if (node->allocations_[sample->size] == 0) {
+ node->allocations_.erase(sample->size);
+ }
sample->profiler->samples_.erase(sample);
delete sample;
}
« no previous file with comments | « no previous file | test/cctest/test-heap-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698