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

Unified Diff: third_party/tcmalloc/chromium/src/heap-profile-table.cc

Issue 8631007: DMP: Fix the number of buckets. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 1 month 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 | 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/heap-profile-table.cc
diff --git a/third_party/tcmalloc/chromium/src/heap-profile-table.cc b/third_party/tcmalloc/chromium/src/heap-profile-table.cc
index 6d75c4a49a861320dd2eb500e9a23058ef54fd07..893fd4e98a26e365d77fab4dd4460698513c93c8 100644
--- a/third_party/tcmalloc/chromium/src/heap-profile-table.cc
+++ b/third_party/tcmalloc/chromium/src/heap-profile-table.cc
@@ -301,8 +301,11 @@ int HeapProfileTable::UnparseBucket(const Bucket& b,
HeapProfileTable::Bucket**
HeapProfileTable::MakeSortedBucketList() const {
+ // We allocate memory for (num_buckets_ + 1) buckets
+ // because this allocations itself could create a new bucket.
+ // There is no harm even if it doesn't create a new bucket.
Bucket** list =
- reinterpret_cast<Bucket**>(alloc_(sizeof(Bucket) * num_buckets_));
+ reinterpret_cast<Bucket**>(alloc_(sizeof(Bucket) * (num_buckets_ + 1)));
int n = 0;
for (int b = 0; b < kHashTableSize; b++) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698