Index: runtime/vm/zone.cc |
diff --git a/runtime/vm/zone.cc b/runtime/vm/zone.cc |
index 8b3cdac905faf210905786168a660c3c15e65329..46288e9876ded6b7baeb66c3b640ec6956b2734d 100644 |
--- a/runtime/vm/zone.cc |
+++ b/runtime/vm/zone.cc |
@@ -77,8 +77,11 @@ Zone::Segment* Zone::Segment::New(intptr_t size, Zone::Segment* next) { |
result->next_ = next; |
result->size_ = size; |
Thread* current = Thread::Current(); |
+ |
if (current != NULL) { |
current->IncrementMemoryUsage(size); |
+ // In case the other thread is waiting to do a scavenge. |
+ current->CheckForSafepoint(); |
siva
2017/03/23 18:05:01
Why is this check needed here? We may run into iss
erikcorry
2017/03/27 10:23:28
Good catch. This one was great for keeping down t
|
} else if (ApiNativeScope::Current() != NULL) { |
// If there is no current thread, we might be inside of a native scope. |
ApiNativeScope::IncrementNativeScopeMemoryUsage(size); |