[compiler-rt] [scudo] [MTE] resize stack depot for allocation ring buffer (PR #74515)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 18 17:50:42 PST 2024


================
@@ -1040,7 +1057,9 @@ class Allocator {
   uptr GuardedAllocSlotSize = 0;
 #endif // GWP_ASAN_HOOKS
 
-  StackDepot Depot;
+  char *RawStackDepot = nullptr;
----------------
ChiaHungDuan wrote:

I suppose you're referring to the discussion [here](https://reviews.llvm.org/D140932#inline-1361723). 

I wasn't sure what the trailing objects types would be and if it has multiple types, the handling of alignment can be tricky thus I agree with having a quick implementation first. Now I just reviewed the concern and checked the C++ standard, as I mentioned, it's safe to use *this* to locate the address at the end of the object, a pointer is only invalid if the storage life has ended. (And this is how we access the trailing objects)

I think we should just use `StackDeopt` (if you want the struct more self-explained, we can use the trailing array). I'm fine with doing the clean up in a follow up CL if that's easier

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


More information about the llvm-commits mailing list