[vm] Adds full GC check on all external allocations

related #33314

Change-Id: I3f715f5c3580c9f865a4579b732ba56c39c69012
Reviewed-on: https://dart-review.googlesource.com/58001
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
Zach Anderson 2018-06-01 20:42:49 +00:00 committed by commit-bot@chromium.org
parent bef7cd354f
commit 90c4215af4

View file

@ -140,9 +140,12 @@ void Heap::AllocateExternal(intptr_t cid, intptr_t size, Space space) {
} else {
ASSERT(space == kOld);
old_space_.AllocateExternal(cid, size);
if (old_space_.NeedsGarbageCollection()) {
CollectAllGarbage();
}
}
// Idle GC does not check whether promotions should trigger a full GC.
// As a workaround, we check here on every external allocation. See issue
// dartbug.com/33314.
if (old_space_.NeedsGarbageCollection()) {
CollectAllGarbage();
}
}