Index: runtime/vm/heap.cc |
diff --git a/runtime/vm/heap.cc b/runtime/vm/heap.cc |
index c5b593e66014874277077296e8d81e8cdba2ac7b..b34af5460018d38e35ee9d4169ff90816a319dd3 100644 |
--- a/runtime/vm/heap.cc |
+++ b/runtime/vm/heap.cc |
@@ -446,6 +446,19 @@ void Heap::CollectAllGarbage() { |
} |
+#if defined(DEBUG) |
+void Heap::WaitForSweeperTasks() { |
+ Thread* thread = Thread::Current(); |
+ { |
+ MonitorLocker ml(old_space_.tasks_lock()); |
+ while (old_space_.tasks() > 0) { |
+ ml.WaitWithSafepointCheck(thread); |
+ } |
+ } |
+} |
+#endif |
+ |
+ |
bool Heap::ShouldPretenure(intptr_t class_id) const { |
if (class_id == kOneByteStringCid) { |
return pretenure_policy_ > 0; |