代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/gperftools 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 1de76671d478e848f0dd210e00df43bfa463ca9f Mon Sep 17 00:00:00 2001
From: Gabriel Marin <gmx@chromium.org>
Date: Thu, 4 Oct 2018 22:52:35 +0000
Subject: [PATCH 31/39] Fix mmap region iteration while no regions are
recorded.
If no mmap regions are recorded, iteration failed since the RegionSet
(std::set) object is not initialized.
Original CL https://codereview.chromium.org/14769008
Reviewed-on: https://chromium-review.googlesource.com/c/1130807
---
src/memory_region_map.cc | 19 +++++++++++++------
src/memory_region_map.h | 3 +++
2 files changed, 16 insertions(+), 6 deletions(-)
mode change 100755 => 100644 src/memory_region_map.cc
diff --git a/src/memory_region_map.cc b/src/memory_region_map.cc
old mode 100755
new mode 100644
index 841d6f3..06b6fb0
--- a/src/memory_region_map.cc
+++ b/src/memory_region_map.cc
@@ -234,6 +234,9 @@ void MemoryRegionMap::Init(int max_stack_depth, bool use_buckets) {
memset(bucket_table_, 0, table_bytes);
num_buckets_ = 0;
}
+ if (regions_ == NULL) { // init regions_
+ InitRegionSetLocked();
+ }
Unlock();
RAW_VLOG(10, "MemoryRegionMap Init done");
}
@@ -536,6 +539,15 @@ void MemoryRegionMap::RestoreSavedBucketsLocked() {
}
}
+inline void MemoryRegionMap::InitRegionSetLocked() {
+ RAW_VLOG(12, "Initializing region set");
+ regions_ = regions_rep.region_set();
+ recursive_insert = true;
+ new (regions_) RegionSet();
+ HandleSavedRegionsLocked(&DoInsertRegionLocked);
+ recursive_insert = false;
+}
+
inline void MemoryRegionMap::InsertRegionLocked(const Region& region) {
RAW_CHECK(LockIsHeld(), "should be held (by this thread)");
// We can be called recursively, because RegionSet constructor
@@ -556,12 +568,7 @@ inline void MemoryRegionMap::InsertRegionLocked(const Region& region) {
saved_regions[saved_regions_count++] = region;
} else { // not a recusrive call
if (regions_ == NULL) { // init regions_
- RAW_VLOG(12, "Initializing region set");
- regions_ = regions_rep.region_set();
- recursive_insert = true;
- new(regions_) RegionSet();
- HandleSavedRegionsLocked(&DoInsertRegionLocked);
- recursive_insert = false;
+ InitRegionSetLocked();
}
recursive_insert = true;
// Do the actual insertion work to put new regions into regions_:
diff --git a/src/memory_region_map.h b/src/memory_region_map.h
index ec388e1..f774994 100644
--- a/src/memory_region_map.h
+++ b/src/memory_region_map.h
@@ -362,6 +362,9 @@ class MemoryRegionMap {
// table where all buckets eventually should be.
static void RestoreSavedBucketsLocked();
+ // Initialize RegionSet regions_.
+ inline static void InitRegionSetLocked();
+
// Wrapper around DoInsertRegionLocked
// that handles the case of recursive allocator calls.
inline static void InsertRegionLocked(const Region& region);
--
1.8.3.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。