summaryrefslogtreecommitdiffstats
path: root/third_party/tcmalloc
diff options
context:
space:
mode:
authorgman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-30 07:28:27 +0000
committergman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-30 07:28:27 +0000
commitcca36dbad6c08c08ce797b2ad3a1ce853c605c01 (patch)
tree006e38b76b4ab7e031f7ae776d5b74ff81b24763 /third_party/tcmalloc
parent7ccc39dcd15f649dda4b9f9d3b628da3115271dc (diff)
downloadchromium_src-cca36dbad6c08c08ce797b2ad3a1ce853c605c01.zip
chromium_src-cca36dbad6c08c08ce797b2ad3a1ce853c605c01.tar.gz
chromium_src-cca36dbad6c08c08ce797b2ad3a1ce853c605c01.tar.bz2
Get DMP to run without HEAP_PROFILE_MMAP=1
This is a step to getting DMP running in Windows. BUG=159993 Review URL: https://chromiumcodereview.appspot.com/11418237 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170417 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/tcmalloc')
-rw-r--r--third_party/tcmalloc/chromium/src/deep-heap-profile.cc39
1 files changed, 22 insertions, 17 deletions
diff --git a/third_party/tcmalloc/chromium/src/deep-heap-profile.cc b/third_party/tcmalloc/chromium/src/deep-heap-profile.cc
index 8535275..4941f8d 100644
--- a/third_party/tcmalloc/chromium/src/deep-heap-profile.cc
+++ b/third_party/tcmalloc/chromium/src/deep-heap-profile.cc
@@ -245,18 +245,21 @@ int DeepHeapProfile::FillOrderedProfile(char raw_buffer[], int buffer_size) {
// Allocate a list for mmap'ed regions.
num_mmap_allocations_ = 0;
- heap_profile_->mmap_address_map_->Iterate(CountMMap, this);
- mmap_list_length_ = 0;
- mmap_list_ = reinterpret_cast<MMapListEntry*>(heap_profile_->alloc_(
- sizeof(MMapListEntry) * num_mmap_allocations_));
-
- // Touch all the allocated pages. Touching is required to avoid new page
- // commitment while filling the list in SnapshotProcMaps.
- for (int i = 0;
- i < num_mmap_allocations_;
- i += getpagesize() / 2 / sizeof(MMapListEntry))
- mmap_list_[i].first_address = 0;
- mmap_list_[num_mmap_allocations_ - 1].last_address = 0;
+ if (heap_profile_->mmap_address_map_) {
+ heap_profile_->mmap_address_map_->Iterate(CountMMap, this);
+
+ mmap_list_length_ = 0;
+ mmap_list_ = reinterpret_cast<MMapListEntry*>(heap_profile_->alloc_(
+ sizeof(MMapListEntry) * num_mmap_allocations_));
+
+ // Touch all the allocated pages. Touching is required to avoid new page
+ // commitment while filling the list in SnapshotProcMaps.
+ for (int i = 0;
+ i < num_mmap_allocations_;
+ i += getpagesize() / 2 / sizeof(MMapListEntry))
+ mmap_list_[i].first_address = 0;
+ mmap_list_[num_mmap_allocations_ - 1].last_address = 0;
+ }
stats_.SnapshotProcMaps(memory_residence_info_getter_, NULL, 0);
@@ -701,11 +704,13 @@ void DeepHeapProfile::GlobalStats::SnapshotAllocations(
deep_profile);
// mmap allocations.
- deep_profile->heap_profile_->mmap_address_map_->Iterate(RecordMMap,
- deep_profile);
- std::sort(deep_profile->mmap_list_,
- deep_profile->mmap_list_ + deep_profile->mmap_list_length_,
- ByFirstAddress);
+ if (deep_profile->heap_profile_->mmap_address_map_) {
+ deep_profile->heap_profile_->mmap_address_map_->Iterate(RecordMMap,
+ deep_profile);
+ std::sort(deep_profile->mmap_list_,
+ deep_profile->mmap_list_ + deep_profile->mmap_list_length_,
+ ByFirstAddress);
+ }
}
void DeepHeapProfile::GlobalStats::Unparse(TextBuffer* buffer) {