[compiler-rt] 12e20a4 - [scudo] Do not consider releasing unallocated pages

Petr Hosek via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 29 18:35:24 PST 2022


Author: Petr Hosek
Date: 2022-11-30T02:34:46Z
New Revision: 12e20a446e4df75a6aa147dd322ba6a34545c2bc

URL: https://github.com/llvm/llvm-project/commit/12e20a446e4df75a6aa147dd322ba6a34545c2bc
DIFF: https://github.com/llvm/llvm-project/commit/12e20a446e4df75a6aa147dd322ba6a34545c2bc.diff

LOG: [scudo] Do not consider releasing unallocated pages

We already know that there are no free blocks above Region->AllocatedUser.
This results in a smaller RegionPageMap and faster releaseFreeMemoryToOS.

Patch By: fabio-d
Differential Revision: https://reviews.llvm.org/D138794

Added: 
    

Modified: 
    compiler-rt/lib/scudo/standalone/primary64.h

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/scudo/standalone/primary64.h b/compiler-rt/lib/scudo/standalone/primary64.h
index d06a047fa659..b653bc802022 100644
--- a/compiler-rt/lib/scudo/standalone/primary64.h
+++ b/compiler-rt/lib/scudo/standalone/primary64.h
@@ -691,7 +691,8 @@ template <typename Config> class SizeClassAllocator64 {
     const uptr GroupSize = (1U << GroupSizeLog);
     const uptr AllocatedUserEnd = Region->AllocatedUser + Region->RegionBeg;
     ReleaseRecorder Recorder(Region->RegionBeg, &Region->Data);
-    PageReleaseContext Context(BlockSize, RegionSize, /*NumberOfRegions=*/1U);
+    PageReleaseContext Context(BlockSize, Region->AllocatedUser,
+                               /*NumberOfRegions=*/1U);
 
     const uptr CompactPtrBase = getCompactPtrBaseByClassId(ClassId);
     auto DecompactPtr = [CompactPtrBase](CompactPtrT CompactPtr) {


        


More information about the llvm-commits mailing list