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

Unified Diff: runtime/vm/object_test.cc

Issue 2995543004: [vm, gc] Require a safepoint for heap iteration. (Closed)
Patch Set: . Created 3 years, 4 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: runtime/vm/object_test.cc
diff --git a/runtime/vm/object_test.cc b/runtime/vm/object_test.cc
index 0b84430850c7ac80bd8b8bd026db4d175375cda5..b4303f2eeb41d3de9e4b0b6085acf7c1b23aaf88 100644
--- a/runtime/vm/object_test.cc
+++ b/runtime/vm/object_test.cc
@@ -4067,8 +4067,11 @@ ISOLATE_UNIT_TEST_CASE(PrintJSON) {
Heap* heap = Isolate::Current()->heap();
heap->CollectAllGarbage();
GrowableArray<Object*> objects;
- ObjectAccumulator acc(&objects);
- heap->IterateObjects(&acc);
+ {
+ HeapIterationScope iteration;
+ ObjectAccumulator acc(&objects);
+ iteration.IterateObjects(&acc);
+ }
for (intptr_t i = 0; i < objects.length(); ++i) {
JSONStream js;
objects[i]->PrintJSON(&js, false);

Powered by Google App Engine
This is Rietveld 408576698