From cdc80a6017076daea28e62a9efb0b3d8a53d8fce Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Tue, 23 Nov 2021 12:41:28 -0800 Subject: [PATCH] [NFC][sanitizer] Move StackStore::Allocated into cpp file --- compiler-rt/lib/sanitizer_common/sanitizer_stack_store.cpp | 4 ++++ compiler-rt/lib/sanitizer_common/sanitizer_stack_store.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_stack_store.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_stack_store.cpp index ad88e2b..74be6df 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 b5bbdcc..35602d2 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(); -- 2.7.4