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: src/profiler/heap-snapshot-generator-inl.h

Issue 2595003002: Use std::deque for storing edges and children in heap snapshot. (Closed)
Patch Set: fix ce Created 3 years, 12 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 | « src/profiler/heap-snapshot-generator.cc ('k') | 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/heap-snapshot-generator-inl.h
diff --git a/src/profiler/heap-snapshot-generator-inl.h b/src/profiler/heap-snapshot-generator-inl.h
index 169ab569e82dc86ef8a4fe1009d9806e682ae370..eeb212a7a3ee32548d0984660cc02b9943d782fb 100644
--- a/src/profiler/heap-snapshot-generator-inl.h
+++ b/src/profiler/heap-snapshot-generator-inl.h
@@ -38,13 +38,17 @@ int HeapEntry::set_children_index(int index) {
return next_index;
}
-
-HeapGraphEdge** HeapEntry::children_arr() {
+std::deque<HeapGraphEdge*>::iterator HeapEntry::children_begin() {
DCHECK(children_index_ >= 0);
- SLOW_DCHECK(children_index_ < snapshot_->children().length() ||
- (children_index_ == snapshot_->children().length() &&
+ SLOW_DCHECK(
+ children_index_ < static_cast<int>(snapshot_->children().size()) ||
+ (children_index_ == static_cast<int>(snapshot_->children().size()) &&
children_count_ == 0));
- return &snapshot_->children().first() + children_index_;
+ return snapshot_->children().begin() + children_index_;
+}
+
+std::deque<HeapGraphEdge*>::iterator HeapEntry::children_end() {
+ return children_begin() + children_count_;
}
« no previous file with comments | « src/profiler/heap-snapshot-generator.cc ('k') | test/cctest/test-heap-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698