From 8e74668e96da5c38c7fabb1881a6510d6a09112d Mon Sep 17 00:00:00 2001 From: Leonard Chan Date: Wed, 23 Jun 2021 16:12:52 -0700 Subject: [PATCH] [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 --- compiler-rt/lib/hwasan/hwasan_thread_list.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler-rt/lib/hwasan/hwasan_thread_list.h b/compiler-rt/lib/hwasan/hwasan_thread_list.h index 8e6c8ad..15916a8 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_); -- 2.7.4