Index: runtime/vm/heap.cc |
diff --git a/runtime/vm/heap.cc b/runtime/vm/heap.cc |
index 71109eeaee5589d5d9766799c6c94baa84fd627f..f6c35eee2c2040e83a4f4526ca6c90e856151b37 100644 |
--- a/runtime/vm/heap.cc |
+++ b/runtime/vm/heap.cc |
@@ -97,11 +97,12 @@ uword Heap::AllocateOld(intptr_t size, HeapPage::PageType type) { |
} |
// If we are in the process of running a sweep wait for the sweeper to free |
zra
2016/01/08 23:32:07
sweep, wait
siva
2016/01/12 21:26:22
Done.
|
// memory. |
+ Thread* thread = Thread::Current(); |
{ |
MonitorLocker ml(old_space_.tasks_lock()); |
addr = old_space_.TryAllocate(size, type); |
while ((addr == 0) && (old_space_.tasks() > 0)) { |
- ml.Wait(); |
+ ml.WaitWithSafepointCheck(thread); |
addr = old_space_.TryAllocate(size, type); |
} |
} |
@@ -119,7 +120,7 @@ uword Heap::AllocateOld(intptr_t size, HeapPage::PageType type) { |
MonitorLocker ml(old_space_.tasks_lock()); |
addr = old_space_.TryAllocate(size, type); |
while ((addr == 0) && (old_space_.tasks() > 0)) { |
- ml.Wait(); |
+ ml.WaitWithSafepointCheck(thread); |
addr = old_space_.TryAllocate(size, type); |
} |
} |
@@ -136,7 +137,7 @@ uword Heap::AllocateOld(intptr_t size, HeapPage::PageType type) { |
{ |
MonitorLocker ml(old_space_.tasks_lock()); |
while (old_space_.tasks() > 0) { |
- ml.Wait(); |
+ ml.WaitWithSafepointCheck(thread); |
} |
} |
addr = old_space_.TryAllocate(size, type, PageSpace::kForceGrowth); |