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

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

Issue 2377513007: [heap] Decouple SpaceIterator from ObjectIterator. (Closed)
Patch Set: 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
Index: src/heap/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index 08472e5b10448949ef761f91de3fbdaedeead34b..c5c68c61e0ce1f79c683dece7c3756ccc817eb12 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);
}
}

Powered by Google App Engine
This is Rietveld 408576698