[compiler-rt] 8e74668 - [NFC][compiler-rt][hwasan] Re-use ring buffer size calculation

Leonard Chan via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 29 11:57:47 PDT 2021


Author: Leonard Chan
Date: 2021-06-29T11:57:33-07:00
New Revision: 8e74668e96da5c38c7fabb1881a6510d6a09112d

URL: https://github.com/llvm/llvm-project/commit/8e74668e96da5c38c7fabb1881a6510d6a09112d
DIFF: https://github.com/llvm/llvm-project/commit/8e74668e96da5c38c7fabb1881a6510d6a09112d.diff

LOG: [NFC][compiler-rt][hwasan] Re-use ring buffer size calculation

Users can call HwasanThreadList::GetRingBufferSize rather than RingBufferSize
to prevent having to do the calculation in RingBufferSize. This will be useful
for Fuchsia where we plan to initialize the stack ring buffer separately from
the rest of thread initialization.

Differential Revision: https://reviews.llvm.org/D104823

Added: 
    

Modified: 
    compiler-rt/lib/hwasan/hwasan_thread_list.h

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/hwasan/hwasan_thread_list.h b/compiler-rt/lib/hwasan/hwasan_thread_list.h
index 8e6c8adf1e59..15916a802d6e 100644
--- a/compiler-rt/lib/hwasan/hwasan_thread_list.h
+++ b/compiler-rt/lib/hwasan/hwasan_thread_list.h
@@ -171,6 +171,8 @@ class HwasanThreadList {
     return stats_;
   }
 
+  uptr GetRingBufferSize() const { return ring_buffer_size_; }
+
  private:
   Thread *AllocThread() {
     SpinMutexLock l(&free_space_mutex_);


        


More information about the llvm-commits mailing list