[compiler-rt] cdc80a6 - [NFC][sanitizer] Move StackStore::Allocated into cpp file

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 23 12:46:29 PST 2021


Author: Vitaly Buka
Date: 2021-11-23T12:46:19-08:00
New Revision: cdc80a6017076daea28e62a9efb0b3d8a53d8fce

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

LOG: [NFC][sanitizer] Move StackStore::Allocated into cpp file

Added: 
    

Modified: 
    compiler-rt/lib/sanitizer_common/sanitizer_stack_store.cpp
    compiler-rt/lib/sanitizer_common/sanitizer_stack_store.h

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_stack_store.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_stack_store.cpp
index ad88e2bbbefcd..74be6df8b8cfa 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_stack_store.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_stack_store.cpp
@@ -31,6 +31,10 @@ StackTrace StackStore::Load(Id id) {
   return StackTrace(stack_trace + 1, size, tag);
 }
 
+uptr StackStore::Allocated() const {
+  return atomic_load_relaxed(&mapped_size_);
+}
+
 uptr *StackStore::TryAlloc(uptr count) {
   // Optimisic lock-free allocation, essentially try to bump the region ptr.
   for (;;) {

diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_stack_store.h b/compiler-rt/lib/sanitizer_common/sanitizer_stack_store.h
index b5bbdccc20b1c..35602d21f3088 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_stack_store.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_stack_store.h
@@ -24,7 +24,7 @@ class StackStore {
 
   Id Store(const StackTrace &trace);
   StackTrace Load(Id id);
-  uptr Allocated() const { return atomic_load_relaxed(&mapped_size_); }
+  uptr Allocated() const;
 
   void TestOnlyUnmap();
 


        


More information about the llvm-commits mailing list