[compiler-rt] [scudo] Add partial chunk heuristic to retrieval algorithm. (PR #104807)

via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 19 16:57:40 PDT 2024


================
@@ -336,6 +337,37 @@ TEST_F(MapAllocatorCacheTest, CacheOrder) {
     MemMap.unmap();
 }
 
+TEST_F(MapAllocatorCacheTest, PartialChunkHeuristicRetrievalTest) {
+  const scudo::uptr MaxUnusedCacheBytes = scudo::MaxUnusedCachePages * PageSize;
+  const scudo::uptr FragmentedBytes =
+      MaxUnusedCacheBytes +
+      scudo::roundDown(scudo::CachedBlock::ReleaseMemoryUpperBound, PageSize);
----------------
ChiaHungDuan wrote:

I think that `scudo::CachedBlock::ReleaseMemoryUpperBound` should always align to `PageSize` so maybe we can remove the roundDown()

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


More information about the llvm-commits mailing list