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

Unified Diff: src/heap/mark-compact.cc

Issue 2377513007: [heap] Decouple SpaceIterator from ObjectIterator. (Closed)
Patch Set: rebase Created 4 years, 3 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/heap/heap-inl.h ('k') | src/heap/spaces.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index 4ca1443c7ae139b425efff470e10d6869afcbd3a..7c08ea0eb23348599643e673bd07dd4dd841debc 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -2266,8 +2266,9 @@ void MarkCompactCollector::VisitAllObjects(HeapObjectVisitor* visitor) {
SpaceIterator space_it(heap());
HeapObject* obj = nullptr;
while (space_it.has_next()) {
- ObjectIterator* it = space_it.next();
- while ((obj = it->Next()) != nullptr) {
+ std::unique_ptr<ObjectIterator> it(space_it.next()->GetObjectIterator());
+ ObjectIterator* obj_it = it.get();
+ while ((obj = obj_it->Next()) != nullptr) {
visitor->Visit(obj);
}
}
« no previous file with comments | « src/heap/heap-inl.h ('k') | src/heap/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698