| Index: runtime/vm/object_test.cc
|
| ===================================================================
|
| --- runtime/vm/object_test.cc (revision 41751)
|
| +++ runtime/vm/object_test.cc (working copy)
|
| @@ -4133,6 +4133,16 @@
|
| TEST_CASE(PrintJSON) {
|
| Heap* heap = Isolate::Current()->heap();
|
| heap->CollectAllGarbage();
|
| + // We don't want to print garbage objects, so wait for concurrent sweeper.
|
| + // TODO(21620): Add heap iteration interface that excludes garbage (or
|
| + // use ObjectGraph).
|
| + PageSpace* old_space = heap->old_space();
|
| + {
|
| + MonitorLocker ml(old_space->tasks_lock());
|
| + while (old_space->tasks() > 0) {
|
| + ml.Wait();
|
| + }
|
| + }
|
| GrowableArray<Object*> objects;
|
| ObjectAccumulator acc(&objects);
|
| heap->IterateObjects(&acc);
|
|
|