[compiler-rt] [scudo] Fix the logic of MaxAllowedFragmentedPages (PR #107927)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 9 15:27:26 PDT 2024
https://github.com/ChiaHungDuan created https://github.com/llvm/llvm-project/pull/107927
MTE doesn't support MaxReleasedCachePages which may break the assumption that only the first 4 pages will have memory tagged.
>From d9b12ee4cff866fe03a9cbd029d7690f565f8873 Mon Sep 17 00:00:00 2001
From: Chia-hung Duan <chiahungduan at google.com>
Date: Mon, 9 Sep 2024 22:17:28 +0000
Subject: [PATCH] [scudo] Fix the logic of MaxAllowedFragmentedPages
MTE doesn't support MaxReleasedCachePages which may break the assumption
that only the first 4 pages will have memory tagged.
---
compiler-rt/lib/scudo/standalone/secondary.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/compiler-rt/lib/scudo/standalone/secondary.h b/compiler-rt/lib/scudo/standalone/secondary.h
index 1a232b9b9fb2d7..7d85832d7fe714 100644
--- a/compiler-rt/lib/scudo/standalone/secondary.h
+++ b/compiler-rt/lib/scudo/standalone/secondary.h
@@ -725,7 +725,7 @@ MapAllocator<Config>::tryAllocateFromCache(const Options &Options, uptr Size,
uptr EntryHeaderPos;
uptr MaxAllowedFragmentedPages = MaxUnreleasedCachePages;
- if (UNLIKELY(useMemoryTagging<Config>(Options)))
+ if (LIKELY(!useMemoryTagging<Config>(Options)))
MaxAllowedFragmentedPages += CachedBlock::MaxReleasedCachePages;
Entry = Cache.retrieve(MaxAllowedFragmentedPages, Size, Alignment,
More information about the llvm-commits
mailing list