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

Christopher Ferris via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 22 19:45:30 PDT 2024


================
@@ -659,8 +721,18 @@ MapAllocator<Config>::tryAllocateFromCache(const Options &Options, uptr Size,
                                            FillContentsMode FillContents) {
   CachedBlock Entry;
   uptr EntryHeaderPos;
+  uptr MaxAllowedFragmentedPages;
+
+  if (LIKELY(!useMemoryTagging<Config>(Options))) {
----------------
cferris1000 wrote:

I realized you can simplify this even more:

  uptr MaxAllowedFragmentedPages = MaxUnreleasedCachePages;
  if (UNLIKELY(useMemoryTagging...)
     MaxAllowedFragmentedPages += CachedBlock::MaxReleasedCachePages;

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


More information about the llvm-commits mailing list