mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 08:44:27 +00:00
[vm] Fix missing null check in FLAG_force_evacuation.
Bug: https://github.com/dart-lang/sdk/issues/37772 Change-Id: I4e62dd0355fe0ebc7716de05a093142389067191 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112403 Commit-Queue: Ryan Macnak <rmacnak@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
parent
271ad96813
commit
4ebde3fa9b
1 changed files with 9 additions and 1 deletions
|
@ -213,11 +213,19 @@ void GCCompactor::Compact(HeapPage* pages,
|
|||
// objects move and all pages that used to have an object are released.
|
||||
// This can be helpful for finding untracked pointers because it prevents
|
||||
// an untracked pointer from getting lucky with its target not moving.
|
||||
for (intptr_t task_index = 0; task_index < num_tasks; task_index++) {
|
||||
bool oom = false;
|
||||
for (intptr_t task_index = 0; task_index < num_tasks && !oom;
|
||||
task_index++) {
|
||||
const intptr_t pages_per_task = num_pages / num_tasks;
|
||||
for (intptr_t j = 0; j < pages_per_task; j++) {
|
||||
HeapPage* page = heap_->old_space()->AllocatePage(HeapPage::kData,
|
||||
/* link */ false);
|
||||
|
||||
if (page == nullptr) {
|
||||
oom = true;
|
||||
break;
|
||||
}
|
||||
|
||||
FreeListElement::AsElement(page->object_start(),
|
||||
page->object_end() - page->object_start());
|
||||
|
||||
|
|
Loading…
Reference in a new issue