[compiler-rt] [NFC] Make RingBuffer an atomic pointer (PR #82547)

via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 21 16:59:41 PST 2024


================
@@ -1061,16 +1064,29 @@ class Allocator {
       atomic_u32 DeallocationTrace;
       atomic_u32 DeallocationTid;
     };
-
+    StackDepot *Depot = nullptr;
+    uptr StackDepotSize = 0;
+    MemMapT RawRingBufferMap;
+    MemMapT RawStackDepotMap;
+    u32 RingBufferElements;
     atomic_uptr Pos;
     // An array of Size (at least one) elements of type Entry is immediately
     // following to this struct.
   };
   // Pointer to memory mapped area starting with AllocationRingBuffer struct,
   // and immediately followed by Size elements of type Entry.
-  char *RawRingBuffer = {};
-  u32 RingBufferElements = 0;
-  MemMapT RawRingBufferMap;
+  atomic_voidptr RingBuffer = {};
----------------
ChiaHungDuan wrote:

I think we can use atomic_uptr here instead

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


More information about the llvm-commits mailing list