[compiler-rt] [scudo] Refactor store() and retrieve(). (PR #102024)

Joshua Baehring via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 5 11:54:28 PDT 2024


================
@@ -692,8 +711,10 @@ void *MapAllocator<Config>::allocate(const Options &Options, uptr Size,
   if (Alignment < PageSize && Cache.canCache(MinNeededSizeForCache)) {
     LargeBlock::Header *H;
     bool Zeroed;
-    if (Cache.retrieve(Options, Size, Alignment, getHeadersSize(), &H,
-                       &Zeroed)) {
+
+    H = tryAllocateFromCache(Options, Size, Alignment, getHeadersSize(),
+                             Zeroed);
+    if (H != nullptr) {
----------------
JoshuaMBa wrote:

We can, but we'll need to pass a few more arguments. Also, I wasn't sure if we should leave the the stats logic inside or outside the call to `tryAllocateFromCache()`. It's probably not a big deal, but my initial thought was to leave handling the allocated data and stats directly in `allocate()`.

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


More information about the llvm-commits mailing list