[compiler-rt] [scudo] [MTE] resize stack depot for allocation ring buffer (PR #74515)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 2 11:43:28 PST 2024
================
@@ -282,16 +283,17 @@ class Allocator {
return reinterpret_cast<void *>(addHeaderTag(reinterpret_cast<uptr>(Ptr)));
}
- NOINLINE u32 collectStackTrace() {
+ NOINLINE u32 collectStackTrace(StackDepot *Depot) {
#ifdef HAVE_ANDROID_UNSAFE_FRAME_POINTER_CHASE
// Discard collectStackTrace() frame and allocator function frame.
constexpr uptr DiscardFrames = 2;
uptr Stack[MaxTraceSize + DiscardFrames];
uptr Size =
android_unsafe_frame_pointer_chase(Stack, MaxTraceSize + DiscardFrames);
Size = Min<uptr>(Size, MaxTraceSize + DiscardFrames);
- return Depot.insert(Stack + Min<uptr>(DiscardFrames, Size), Stack + Size);
+ return Depot->insert(Stack + Min<uptr>(DiscardFrames, Size), Stack + Size);
#else
+ (void)(Depot);
----------------
ChiaHungDuan wrote:
In Scudo, we mark the argument as `UNUSED` (even it's not always unused)
https://github.com/llvm/llvm-project/pull/74515
More information about the llvm-commits
mailing list