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

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


================
@@ -688,14 +688,16 @@ class Allocator {
     Quarantine.disable();
     Primary.disable();
     Secondary.disable();
-    if (Depot)
-      Depot->disable();
+    AllocationRingBuffer *RB = getRingBuffer();
+    if (RB)
+      RB->Depot->disable();
   }
 
   void enable() NO_THREAD_SAFETY_ANALYSIS {
     initThreadMaybe();
-    if (Depot)
-      Depot->enable();
+    AllocationRingBuffer *RB = getRingBuffer();
+    if (RB)
+      RB->Depot->enable();
----------------
ChiaHungDuan wrote:

I would prefer adding a function in `AllocationRingBuffer`. So we only need to 
```
getRingBuffer()->enable();
```
Same as the `disable`

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


More information about the llvm-commits mailing list