[compiler-rt] [NFC] Make RingBuffer an atomic pointer (PR #82547)
Florian Mayer via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 21 17:06:22 PST 2024
================
@@ -1259,27 +1275,22 @@ class Allocator {
storeEndMarker(RoundNewPtr, NewSize, BlockEnd);
}
- StackDepot *getDepotIfEnabled(const Options &Options) {
- if (!UNLIKELY(Options.get(OptionBit::TrackAllocationStacks)))
- return nullptr;
- return Depot;
- }
-
void storePrimaryAllocationStackMaybe(const Options &Options, void *Ptr) {
- auto *Depot = getDepotIfEnabled(Options);
- if (!Depot)
+ auto *RingBuffer = getRingBufferIfEnabled(Options);
+ if (!RingBuffer)
return;
auto *Ptr32 = reinterpret_cast<u32 *>(Ptr);
- Ptr32[MemTagAllocationTraceIndex] = collectStackTrace(Depot);
+ Ptr32[MemTagAllocationTraceIndex] = collectStackTrace(RingBuffer->Depot);
Ptr32[MemTagAllocationTidIndex] = getThreadID();
}
- void storeRingBufferEntry(void *Ptr, u32 AllocationTrace, u32 AllocationTid,
+ void storeRingBufferEntry(AllocationRingBuffer *RB, void *Ptr,
----------------
fmayer wrote:
I suggest we change to
```
RingBuffer => RingBufferPtr
Var of AllocationRingBuffer => RB
RawRingBuffer => RBEntryAddress (and do the indexing in the same line)
```
I think "raw" is a bit confusing, especially as it meant something else before.
https://github.com/llvm/llvm-project/pull/82547
More information about the llvm-commits
mailing list