void WeakSet::sweep() { for (WeakBlock* block = m_blocks.head(); block; block = block->next()) block->sweep(); resetAllocator(); }
WeakSet::~WeakSet() { WeakBlock* next = 0; for (WeakBlock* block = m_blocks.head(); block; block = next) { next = block->next(); WeakBlock::destroy(block); } m_blocks.clear(); }
WeakSet::~WeakSet() { WeakBlock* next = 0; for (WeakBlock* block = m_blocks.head(); block; block = next) { next = block->next(); heap()->blockAllocator().deallocate(WeakBlock::destroy(block)); } m_blocks.clear(); }
WeakSet::~WeakSet() { if (isOnList()) remove(); Heap& heap = *this->heap(); WeakBlock* next = 0; for (WeakBlock* block = m_blocks.head(); block; block = next) { next = block->next(); WeakBlock::destroy(heap, block); } m_blocks.clear(); }
void WeakSet::sweep() { WeakBlock* next; for (WeakBlock* block = m_blocks.head(); block; block = next) { next = block->next(); // If a block is completely empty, a new sweep won't have any effect. if (block->isEmpty()) continue; block->takeSweepResult(); // Force a new sweep by discarding the last sweep. block->sweep(); } }
void WeakSet::shrink() { WeakBlock* next; for (WeakBlock* block = m_blocks.head(); block; block = next) { next = block->next(); if (block->isEmpty()) removeAllocator(block); } resetAllocator(); if (m_blocks.isEmpty() && isOnList()) remove(); }
void WeakSet::sweep() { for (WeakBlock* block = m_blocks.head(); block;) { heap()->sweepNextLogicallyEmptyWeakBlock(); WeakBlock* nextBlock = block->next(); block->sweep(); if (block->isLogicallyEmptyButNotFree()) { // If this WeakBlock is logically empty, but still has Weaks pointing into it, // we can't destroy it just yet. Detach it from the WeakSet and hand ownership // to the Heap so we don't pin down the entire MarkedBlock or LargeAllocation. m_blocks.remove(block); heap()->addLogicallyEmptyWeakBlock(block); block->disconnectContainer(); } block = nextBlock; } resetAllocator(); }