[compiler-rt] [scudo] Fix release to OS logic in secondary cache. (PR #103303)

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 13 16:09:01 PDT 2024


================
@@ -336,6 +336,31 @@ TEST_F(MapAllocatorCacheTest, CacheOrder) {
     MemMap.unmap();
 }
 
+TEST_F(MapAllocatorCacheTest, CacheOrderWithRelease) {
+  std::vector<scudo::MemMapT> MemMaps;
+  Cache->setOption(scudo::Option::MaxCacheEntriesCount,
+                   CacheConfig::getEntriesArraySize());
+
+  fillCacheWithSameSizeBlocks(MemMaps, CacheConfig::getEntriesArraySize() - 1,
+                              TestAllocSize);
+
+  // Enable releases and perform a deallocation to trigger releases
+  Cache->setOption(scudo::Option::ReleaseInterval, 0);
----------------
ChiaHungDuan wrote:

Why don't we just do an explicit release? 

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


More information about the llvm-commits mailing list