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();