Bug 1744979 - Update chunk metadata correctly when decommitting empty chunks in response to out of memory r=sfink

Differential Revision: https://phabricator.services.mozilla.com/D133216
This commit is contained in:
Jon Coppeard 2021-12-09 10:14:26 +00:00
Родитель a4eea925db
Коммит d42b285136
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -382,7 +382,8 @@ bool TenuredChunk::decommitOneFreePage(GCRuntime* gc, size_t pageIndex,
bool ok;
{
AutoUnlockGC unlock(lock);
ok = MarkPagesUnusedSoft(pageAddress(pageIndex), PageSize);
ok = !oom::ShouldFailWithOOM() &&
MarkPagesUnusedSoft(pageAddress(pageIndex), PageSize);
}
// Mark the page as decommited if successful or restore the original free
@ -423,6 +424,11 @@ void TenuredChunk::decommitFreeArenasWithoutUnlocking(const AutoLockGC& lock) {
}
decommittedPages[i] = true;
for (size_t j = 0; j < ArenasPerPage; ++j) {
size_t arenaIndex = i * ArenasPerPage + j;
MOZ_ASSERT(freeCommittedArenas[arenaIndex]);
freeCommittedArenas[arenaIndex] = false;
}
info.numArenasFreeCommitted -= ArenasPerPage;
}