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

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

Issue 9963095: Reserve a dedicated arena for every construction of mmap_address_map. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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: 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 1ef18586e4d050e6e0d1ded2b5ca2df256c058be..83ae150f255d3bddf9a7b4e589bbd78777ee649f 100644
--- a/third_party/tcmalloc/chromium/src/heap-profile-table.cc
+++ b/third_party/tcmalloc/chromium/src/heap-profile-table.cc
@@ -66,6 +66,7 @@
#include "memory_region_map.h"
#include "base/commandlineflags.h"
#include "base/logging.h" // for the RawFD I/O commands
+#include "base/low_level_alloc.h"
#include "base/sysinfo.h"
using std::sort;
@@ -355,7 +356,8 @@ HeapProfileTable::MakeSortedBucketList() const {
return list;
}
-void HeapProfileTable::RefreshMMapData() {
+void HeapProfileTable::RefreshMMapData(Allocator mmap_alloc,
+ DeAllocator mmap_dealloc) {
// Make the table
static const int mmap_table_bytes = kHashTableSize * sizeof(*mmap_table_);
if (mmap_table_ == NULL) {
@@ -364,9 +366,9 @@ void HeapProfileTable::RefreshMMapData() {
}
num_available_mmap_buckets_ = 0;
- ClearMMapData();
- mmap_address_map_ =
- new(alloc_(sizeof(AllocationMap))) AllocationMap(alloc_, dealloc_);
+ ClearMMapData(mmap_dealloc);
+ mmap_address_map_ = new(mmap_alloc(sizeof(AllocationMap)))
+ AllocationMap(mmap_alloc, mmap_dealloc);
MemoryRegionMap::LockHolder l;
for (MemoryRegionMap::RegionIterator r =
@@ -387,11 +389,11 @@ void HeapProfileTable::RefreshMMapData() {
}
}
-void HeapProfileTable::ClearMMapData() {
+void HeapProfileTable::ClearMMapData(DeAllocator mmap_dealloc) {
if (mmap_address_map_ != NULL) {
jar (doing other things) 2012/04/04 17:38:40 nit: early return on "== NULL" will mean you won't
Dai Mikurube (NOT FULLTIME) 2012/04/05 05:19:26 Done.
mmap_address_map_->Iterate(ZeroBucketCountsIterator, this);
mmap_address_map_->~AllocationMap();
- dealloc_(mmap_address_map_);
+ mmap_dealloc(mmap_address_map_);
mmap_address_map_ = NULL;
}
}

Powered by Google App Engine
This is Rietveld 408576698