void BlockDirectory::sweep() { m_unswept.forEachSetBit( [&] (size_t index) { MarkedBlock::Handle* block = m_blocks[index]; block->sweep(nullptr); }); }
void MarkedAllocator::sweep() { m_unswept.forEachSetBit( [&] (size_t index) { MarkedBlock::Handle* block = m_blocks[index]; block->sweep(); }); }
bool MarkedAllocator::isPagedOut(double deadline) { unsigned itersSinceLastTimeCheck = 0; for (size_t index = 0; index < m_blocks.size(); ++index) { MarkedBlock::Handle* block = m_blocks[index]; if (block) block->block().updateNeedsDestruction(); ++itersSinceLastTimeCheck; if (itersSinceLastTimeCheck >= Heap::s_timeCheckResolution) { double currentTime = WTF::monotonicallyIncreasingTime(); if (currentTime > deadline) return true; itersSinceLastTimeCheck = 0; } } return false; }