Lines Matching defs:BG

136       for (BatchGroupT &BG : Sci->FreeListInfo.BlockList) {
137 // `BG::Batches` are `TransferBatches`. +1 for `BatchGroup`.
138 BatchClassUsedInFreeLists += BG.Batches.size() + 1;
139 for (const auto &It : BG.Batches)
151 for (BatchGroupT &BG : Sci->FreeListInfo.BlockList) {
152 if (LIKELY(!BG.Batches.empty())) {
153 for (const auto &It : BG.Batches)
517 BatchGroupT *BG = Sci->FreeListInfo.BlockList.front();
519 if (BG == nullptr) {
521 BG = reinterpret_cast<BatchGroupT *>(
524 BG->Batches.clear();
527 BG->CompactPtrGroupBase = 0;
528 // `BG` is also the block of BatchClassId. Note that this is different
530 BG->PushedBlocks = 1;
531 BG->BytesInBGAtLastCheckpoint = 0;
532 BG->MaxCachedPerBatch =
535 Sci->FreeListInfo.BlockList.push_front(BG);
544 if (BG->Batches.empty()) {
553 compactPtr(SizeClassMap::BatchClassId, reinterpret_cast<uptr>(BG)));
555 DCHECK_EQ(BG->PushedBlocks, 1U);
557 BG->PushedBlocks += 1;
558 BG->Batches.push_front(TB);
561 TransferBatchT *CurBatch = BG->Batches.front();
566 static_cast<u16>(BG->MaxCachedPerBatch - CurBatch->getCount());
576 BG->Batches.push_front(CurBatch);
577 UnusedSlots = static_cast<u16>(BG->MaxCachedPerBatch - 1);
585 BG->PushedBlocks += Size;
589 // FreeListInfo.BlockList - > BG -> BG -> BG
597 // Each BlockGroup(BG) will associate with unique group id and the free blocks
612 BatchGroupT *BG =
614 BG->Batches.clear();
619 BG->CompactPtrGroupBase = CompactPtrGroupBase;
620 BG->Batches.push_front(TB);
621 BG->PushedBlocks = 0;
622 BG->BytesInBGAtLastCheckpoint = 0;
623 BG->MaxCachedPerBatch = TransferBatchT::MaxNumCached;
625 return BG;
628 auto InsertBlocks = [&](BatchGroupT *BG, CompactPtrT *Array, u32 Size) {
629 SinglyLinkedList<TransferBatchT> &Batches = BG->Batches;
634 DCHECK_GE(BG->MaxCachedPerBatch, CurBatch->getCount());
636 static_cast<u16>(BG->MaxCachedPerBatch - CurBatch->getCount());
642 UnusedSlots = BG->MaxCachedPerBatch;
650 BG->PushedBlocks += Size;
726 BatchGroupT *BG = Sci->FreeListInfo.BlockList.front();
731 TransferBatchT *TB = reinterpret_cast<TransferBatchT *>(BG);
768 BatchGroupT *BG = Sci->FreeListInfo.BlockList.front();
777 C->deallocate(SizeClassMap::BatchClassId, BG);
1090 for (BatchGroupT &BG : Sci->FreeListInfo.BlockList) {
1091 const uptr GroupBase = decompactGroupBase(BG.CompactPtrGroupBase);
1101 // TransferBatches are pushed in front of BG.Batches. The first one may
1103 const uptr NumBlocks = (BG.Batches.size() - 1) * BG.MaxCachedPerBatch +
1104 BG.Batches.front()->getCount();
1108 if (BytesInBG <= BG.BytesInBGAtLastCheckpoint) {
1109 BG.BytesInBGAtLastCheckpoint = BytesInBG;
1113 const uptr PushedBytesDelta = BytesInBG - BG.BytesInBGAtLastCheckpoint;
1128 BG.BytesInBGAtLastCheckpoint = BytesInBG;
1134 for (const auto &It : BG.Batches)
1136 DCHECK_EQ(compactPtrGroupBase(It.get(I)), BG.CompactPtrGroupBase);
1147 Context.markFreeBlocksInRegion(BG.Batches, DecompactPtr, GroupBase,