mirror of
https://github.com/dart-lang/sdk
synced 2024-10-03 13:11:15 +00:00
[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:
parent
bef7cd354f
commit
90c4215af4
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue