[compiler-rt] [scudo] Make block storage in TransferBatch trailing objects (PR #144204)

Christopher Ferris via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 17 14:36:56 PDT 2025


================
@@ -970,27 +979,26 @@ template <typename Config> class SizeClassAllocator64 {
       Region->FreeListInfo.BlockList.pop_front();
 
       // Block used by `BatchGroup` is from BatchClassId. Turn the block into
-      // `TransferBatch` with single block.
-      TransferBatchT *TB = reinterpret_cast<TransferBatchT *>(BG);
+      // `Batch` with single block.
+      BatchT *TB = reinterpret_cast<BatchT *>(BG);
       ToArray[0] =
           compactPtr(SizeClassMap::BatchClassId, reinterpret_cast<uptr>(TB));
       Region->FreeListInfo.PoppedBlocks += 1;
       return 1U;
     }
 
     // So far, instead of always filling blocks to `MaxBlockCount`, we only
-    // examine single `TransferBatch` to minimize the time spent in the primary
-    // allocator. Besides, the sizes of `TransferBatch` and
-    // `SizeClassAllocatorT::getMaxCached()` may also impact the time spent on
-    // accessing the primary allocator.
+    // examine single `Batch` to minimize the time spent in the primary
+    // allocator. Besides, the sizes of `Batch` and `CacheT::getMaxCached()` may
+    // also impact the time spent on accessing the primary allocator.
     // TODO(chiahungduan): Evaluate if we want to always prepare `MaxBlockCount`
-    // blocks and/or adjust the size of `TransferBatch` according to
-    // `SizeClassAllocatorT::getMaxCached()`.
-    TransferBatchT *B = Batches.front();
+    // blocks and/or adjust the size of `Batch` according to
+    // `CacheT::getMaxCached()`.
----------------
cferris1000 wrote:

Same as above SizeClassAllocatorT instead of CacheT.

https://github.com/llvm/llvm-project/pull/144204


More information about the llvm-commits mailing list