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

Joshua Baehring via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 13 16:07:55 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
----------------
JoshuaMBa wrote:

Yes, when `fillCacheWithSameSizeBlocks()` is called, this will trigger a deallocation which calls `store()`. Did you want me to put the comment about this directly above the call to `fillCacheWithSameSizeBlocks()`?

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


More information about the llvm-commits mailing list