Lines Matching defs:BG
182 for (BatchGroupT &BG : Region->FreeListInfo.BlockList) {
183 // `BG::Batches` are `TransferBatches`. +1 for `BatchGroup`.
184 BatchClassUsedInFreeLists += BG.Batches.size() + 1;
185 for (const auto &It : BG.Batches)
199 for (BatchGroupT &BG : Region->FreeListInfo.BlockList) {
200 if (LIKELY(!BG.Batches.empty())) {
201 for (const auto &It : BG.Batches)
688 BatchGroupT *BG = Region->FreeListInfo.BlockList.front();
690 if (BG == nullptr) {
692 BG = reinterpret_cast<BatchGroupT *>(
695 BG->Batches.clear();
698 BG->CompactPtrGroupBase = 0;
699 BG->BytesInBGAtLastCheckpoint = 0;
700 BG->MaxCachedPerBatch =
703 Region->FreeListInfo.BlockList.push_front(BG);
712 if (BG->Batches.empty()) {
721 compactPtr(SizeClassMap::BatchClassId, reinterpret_cast<uptr>(BG)));
723 BG->Batches.push_front(TB);
726 TransferBatchT *CurBatch = BG->Batches.front();
731 static_cast<u16>(BG->MaxCachedPerBatch - CurBatch->getCount());
741 BG->Batches.push_front(CurBatch);
742 UnusedSlots = static_cast<u16>(BG->MaxCachedPerBatch - 1);
753 // FreeListInfo.BlockList - > BG -> BG -> BG
761 // Each BlockGroup(BG) will associate with unique group id and the free blocks
774 BatchGroupT *BG =
776 BG->Batches.clear();
781 BG->CompactPtrGroupBase = CompactPtrGroupBase;
782 BG->Batches.push_front(TB);
783 BG->BytesInBGAtLastCheckpoint = 0;
784 BG->MaxCachedPerBatch = TransferBatchT::MaxNumCached;
786 return BG;
789 auto InsertBlocks = [&](BatchGroupT *BG, CompactPtrT *Array, u32 Size) {
790 SinglyLinkedList<TransferBatchT> &Batches = BG->Batches;
795 DCHECK_GE(BG->MaxCachedPerBatch, CurBatch->getCount());
797 static_cast<u16>(BG->MaxCachedPerBatch - CurBatch->getCount());
803 UnusedSlots = BG->MaxCachedPerBatch;
960 BatchGroupT *BG = Region->FreeListInfo.BlockList.front();
965 TransferBatchT *TB = reinterpret_cast<TransferBatchT *>(BG);
1002 BatchGroupT *BG = Region->FreeListInfo.BlockList.front();
1011 C->deallocate(SizeClassMap::BatchClassId, BG);
1464 for (BatchGroupT *BG = Region->FreeListInfo.BlockList.front(),
1466 BG != nullptr;) {
1481 decompactGroupBase(CompactPtrBase, BG->CompactPtrGroupBase);
1485 // TransferBatches are pushed in front of BG.Batches. The first one may
1487 const uptr NumBlocks = (BG->Batches.size() - 1) * BG->MaxCachedPerBatch +
1488 BG->Batches.front()->getCount();
1491 if (BytesInBG <= BG->BytesInBGAtLastCheckpoint) {
1492 BG->BytesInBGAtLastCheckpoint = BytesInBG;
1493 Prev = BG;
1494 BG = BG->Next;
1498 const uptr PushedBytesDelta = BytesInBG - BG->BytesInBGAtLastCheckpoint;
1500 Prev = BG;
1501 BG = BG->Next;
1548 Prev = BG;
1549 BG = BG->Next;
1554 // If `BG` is the first BatchGroupT in the list, we only need to advance
1555 // `BG` and call FreeListInfo.BlockList::pop_front(). No update is needed
1558 // (BG) (BG->Next)
1559 // Prev Cur BG
1569 // (BG) (BG->Next)
1570 // Prev Cur BG
1579 // Prev Cur BG
1590 BatchGroupT *Cur = BG;
1591 BG = BG->Next;
1652 for (BatchGroupT &BG : GroupsToRelease) {
1654 decompactGroupBase(CompactPtrBase, BG.CompactPtrGroupBase);
1669 const uptr NumBlocks = (BG.Batches.size() - 1) * BG.MaxCachedPerBatch +
1670 BG.Batches.front()->getCount();
1673 for (const auto &It : BG.Batches) {
1674 if (&It != BG.Batches.front())
1675 DCHECK_EQ(It.getCount(), BG.MaxCachedPerBatch);
1677 DCHECK_EQ(compactPtrGroup(It.get(I)), BG.CompactPtrGroupBase);
1689 BG.Batches, DecompactPtr, Region->RegionBeg, /*RegionIndex=*/0,
1721 for (BatchGroupT *BG = Region->FreeListInfo.BlockList.front(),
1724 if (BG == nullptr || GroupsToRelease.empty()) {
1730 DCHECK(!BG->Batches.empty());
1732 if (BG->CompactPtrGroupBase <
1734 Prev = BG;
1735 BG = BG->Next;
1743 if (BG->CompactPtrGroupBase == Cur->CompactPtrGroupBase) {
1746 BG->BytesInBGAtLastCheckpoint = Cur->BytesInBGAtLastCheckpoint;
1747 const uptr MaxCachedPerBatch = BG->MaxCachedPerBatch;
1753 BG->Batches.append_back(&Cur->Batches);
1759 BG->Batches.append_back(&Cur->Batches);
1761 if (BG->Batches.front()->getCount() == MaxCachedPerBatch) {
1763 BG->Batches.push_front(NonFullBatch);
1767 BG->Batches.front()->getCount()),
1769 BG->Batches.front()->appendFromTransferBatch(NonFullBatch,
1774 BG->Batches.push_front(NonFullBatch);
1793 Prev = BG;
1794 BG = BG->Next;
1798 // At here, the `BG` is the first BatchGroup with CompactPtrGroupBase
1800 // `GroupsToRelease::front()` (which is `Cur` below) before `BG`.
1806 // Afterwards, we don't need to advance `BG` because the order between
1807 // `BG` and the new `GroupsToRelease::front()` hasn't been checked.
1812 DCHECK_EQ(Cur->Next, BG);