Lines Matching +full:5 +full:bg
182 for (BatchGroupT &BG : Region->FreeListInfo.BlockList) { in verifyAllBlocksAreReleasedTestOnly()
183 // `BG::Batches` are `TransferBatches`. +1 for `BatchGroup`. in verifyAllBlocksAreReleasedTestOnly()
184 BatchClassUsedInFreeLists += BG.Batches.size() + 1; in verifyAllBlocksAreReleasedTestOnly()
185 for (const auto &It : BG.Batches) in verifyAllBlocksAreReleasedTestOnly()
199 for (BatchGroupT &BG : Region->FreeListInfo.BlockList) { in verifyAllBlocksAreReleasedTestOnly()
200 if (LIKELY(!BG.Batches.empty())) { in verifyAllBlocksAreReleasedTestOnly()
201 for (const auto &It : BG.Batches) in verifyAllBlocksAreReleasedTestOnly()
670 BatchGroupT *BG = Region->FreeListInfo.BlockList.front(); in pushBatchClassBlocks() local
672 if (BG == nullptr) { in pushBatchClassBlocks()
674 BG = reinterpret_cast<BatchGroupT *>( in pushBatchClassBlocks()
677 BG->Batches.clear(); in pushBatchClassBlocks()
680 BG->CompactPtrGroupBase = 0; in pushBatchClassBlocks()
681 // `BG` is also the block of BatchClassId. Note that this is different in pushBatchClassBlocks()
683 BG->PushedBlocks = 1; in pushBatchClassBlocks()
684 BG->BytesInBGAtLastCheckpoint = 0; in pushBatchClassBlocks()
685 BG->MaxCachedPerBatch = in pushBatchClassBlocks()
688 Region->FreeListInfo.BlockList.push_front(BG); in pushBatchClassBlocks()
697 if (BG->Batches.empty()) { in pushBatchClassBlocks()
706 compactPtr(SizeClassMap::BatchClassId, reinterpret_cast<uptr>(BG))); in pushBatchClassBlocks()
708 DCHECK_EQ(BG->PushedBlocks, 1U); in pushBatchClassBlocks()
710 BG->PushedBlocks += 1; in pushBatchClassBlocks()
711 BG->Batches.push_front(TB); in pushBatchClassBlocks()
714 TransferBatchT *CurBatch = BG->Batches.front(); in pushBatchClassBlocks()
719 static_cast<u16>(BG->MaxCachedPerBatch - CurBatch->getCount()); in pushBatchClassBlocks()
729 BG->Batches.push_front(CurBatch); in pushBatchClassBlocks()
730 UnusedSlots = static_cast<u16>(BG->MaxCachedPerBatch - 1); in pushBatchClassBlocks()
738 BG->PushedBlocks += Size; in pushBatchClassBlocks()
743 // FreeListInfo.BlockList - > BG -> BG -> BG
751 // Each BlockGroup(BG) will associate with unique group id and the free blocks
764 BatchGroupT *BG = variable
766 BG->Batches.clear();
771 BG->CompactPtrGroupBase = CompactPtrGroupBase;
772 BG->Batches.push_front(TB);
773 BG->PushedBlocks = 0;
774 BG->BytesInBGAtLastCheckpoint = 0;
775 BG->MaxCachedPerBatch = TransferBatchT::MaxNumCached;
777 return BG;
780 auto InsertBlocks = [&](BatchGroupT *BG, CompactPtrT *Array, u32 Size) {
781 SinglyLinkedList<TransferBatchT> &Batches = BG->Batches;
786 DCHECK_GE(BG->MaxCachedPerBatch, CurBatch->getCount());
788 static_cast<u16>(BG->MaxCachedPerBatch - CurBatch->getCount());
794 UnusedSlots = BG->MaxCachedPerBatch;
802 BG->PushedBlocks += Size;
953 BatchGroupT *BG = Region->FreeListInfo.BlockList.front(); in popBlocksImpl() local
958 TransferBatchT *TB = reinterpret_cast<TransferBatchT *>(BG); in popBlocksImpl()
995 BatchGroupT *BG = Region->FreeListInfo.BlockList.front(); in popBlocksImpl() local
1004 C->deallocate(SizeClassMap::BatchClassId, BG); in popBlocksImpl()
1244 // and lock it again before step 5.
1275 // 5. Merge the `GroupsToRelease` back to the freelist.
1361 for (BatchGroupT *BG = Region->FreeListInfo.BlockList.front(), in collectGroupsToRelease() local
1363 BG != nullptr;) { in collectGroupsToRelease()
1378 decompactGroupBase(CompactPtrBase, BG->CompactPtrGroupBase); in collectGroupsToRelease()
1382 // TransferBatches are pushed in front of BG.Batches. The first one may in collectGroupsToRelease()
1384 const uptr NumBlocks = (BG->Batches.size() - 1) * BG->MaxCachedPerBatch + in collectGroupsToRelease()
1385 BG->Batches.front()->getCount(); in collectGroupsToRelease()
1388 if (BytesInBG <= BG->BytesInBGAtLastCheckpoint) { in collectGroupsToRelease()
1389 BG->BytesInBGAtLastCheckpoint = BytesInBG; in collectGroupsToRelease()
1390 Prev = BG; in collectGroupsToRelease()
1391 BG = BG->Next; in collectGroupsToRelease()
1395 const uptr PushedBytesDelta = BytesInBG - BG->BytesInBGAtLastCheckpoint; in collectGroupsToRelease()
1440 Prev = BG; in collectGroupsToRelease()
1441 BG = BG->Next; in collectGroupsToRelease()
1446 // If `BG` is the first BatchGroupT in the list, we only need to advance in collectGroupsToRelease()
1447 // `BG` and call FreeListInfo.BlockList::pop_front(). No update is needed in collectGroupsToRelease()
1450 // (BG) (BG->Next) in collectGroupsToRelease()
1451 // Prev Cur BG in collectGroupsToRelease()
1461 // (BG) (BG->Next) in collectGroupsToRelease()
1462 // Prev Cur BG in collectGroupsToRelease()
1471 // Prev Cur BG in collectGroupsToRelease()
1482 BatchGroupT *Cur = BG; in collectGroupsToRelease()
1483 BG = BG->Next; in collectGroupsToRelease()
1544 for (BatchGroupT &BG : GroupsToRelease) { in markFreeBlocks()
1546 decompactGroupBase(CompactPtrBase, BG.CompactPtrGroupBase); in markFreeBlocks()
1561 const uptr NumBlocks = (BG.Batches.size() - 1) * BG.MaxCachedPerBatch + in markFreeBlocks()
1562 BG.Batches.front()->getCount(); in markFreeBlocks()
1565 for (const auto &It : BG.Batches) { in markFreeBlocks()
1566 if (&It != BG.Batches.front()) in markFreeBlocks()
1567 DCHECK_EQ(It.getCount(), BG.MaxCachedPerBatch); in markFreeBlocks()
1569 DCHECK_EQ(compactPtrGroup(It.get(I)), BG.CompactPtrGroupBase); in markFreeBlocks()
1581 BG.Batches, DecompactPtr, Region->RegionBeg, /*RegionIndex=*/0, in markFreeBlocks()
1613 for (BatchGroupT *BG = Region->FreeListInfo.BlockList.front(), in mergeGroupsToReleaseBack() local
1616 if (BG == nullptr || GroupsToRelease.empty()) { in mergeGroupsToReleaseBack()
1622 DCHECK(!BG->Batches.empty()); in mergeGroupsToReleaseBack()
1624 if (BG->CompactPtrGroupBase < in mergeGroupsToReleaseBack()
1626 Prev = BG; in mergeGroupsToReleaseBack()
1627 BG = BG->Next; in mergeGroupsToReleaseBack()
1635 if (BG->CompactPtrGroupBase == Cur->CompactPtrGroupBase) { in mergeGroupsToReleaseBack()
1636 BG->PushedBlocks += Cur->PushedBlocks; in mergeGroupsToReleaseBack()
1639 BG->BytesInBGAtLastCheckpoint = Cur->BytesInBGAtLastCheckpoint; in mergeGroupsToReleaseBack()
1640 const uptr MaxCachedPerBatch = BG->MaxCachedPerBatch; in mergeGroupsToReleaseBack()
1646 BG->Batches.append_back(&Cur->Batches); in mergeGroupsToReleaseBack()
1652 BG->Batches.append_back(&Cur->Batches); in mergeGroupsToReleaseBack()
1654 if (BG->Batches.front()->getCount() == MaxCachedPerBatch) { in mergeGroupsToReleaseBack()
1656 BG->Batches.push_front(NonFullBatch); in mergeGroupsToReleaseBack()
1660 BG->Batches.front()->getCount()), in mergeGroupsToReleaseBack()
1662 BG->Batches.front()->appendFromTransferBatch(NonFullBatch, in mergeGroupsToReleaseBack()
1667 BG->Batches.push_front(NonFullBatch); in mergeGroupsToReleaseBack()
1686 Prev = BG; in mergeGroupsToReleaseBack()
1687 BG = BG->Next; in mergeGroupsToReleaseBack()
1691 // At here, the `BG` is the first BatchGroup with CompactPtrGroupBase in mergeGroupsToReleaseBack()
1693 // `GroupsToRelease::front()` (which is `Cur` below) before `BG`. in mergeGroupsToReleaseBack()
1699 // Afterwards, we don't need to advance `BG` because the order between in mergeGroupsToReleaseBack()
1700 // `BG` and the new `GroupsToRelease::front()` hasn't been checked. in mergeGroupsToReleaseBack()
1705 DCHECK_EQ(Cur->Next, BG); in mergeGroupsToReleaseBack()