[compiler-rt] [scudo] Update secondary cache time-based release logic. (PR #107507)

via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 12 12:59:04 PDT 2024


================
@@ -318,9 +318,10 @@ class MapAllocatorCache {
         }
         CachedBlock PrevEntry = Quarantine[QuarantinePos];
         Quarantine[QuarantinePos] = Entry;
-        if (OldestTime == 0)
-          OldestTime = Entry.Time;
         Entry = PrevEntry;
+        // Set entry time once more to reflect time
+        // that quarantined memory was placed in the cache
+        Entry.Time = Time;
----------------
ChiaHungDuan wrote:

I see. sorry I missed the `Entry = PrevEntry` part. 

Then it's better to say something like "update the entry time ..." in the comment. The `Set entry time once more` makes me think that we need to update the same entry.time twice but they are different entries.

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


More information about the llvm-commits mailing list