diff options
Diffstat (limited to 'absl/profiling')
-rw-r--r-- | absl/profiling/internal/sample_recorder.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/absl/profiling/internal/sample_recorder.h b/absl/profiling/internal/sample_recorder.h index 5e04a9cd..6c146210 100644 --- a/absl/profiling/internal/sample_recorder.h +++ b/absl/profiling/internal/sample_recorder.h @@ -75,6 +75,7 @@ class SampleRecorder { // samples that have been dropped. int64_t Iterate(const std::function<void(const T& stack)>& f); + int32_t GetMaxSamples() const; void SetMaxSamples(int32_t max); private: @@ -223,6 +224,11 @@ void SampleRecorder<T>::SetMaxSamples(int32_t max) { max_samples_.store(max, std::memory_order_release); } +template <typename T> +int32_t SampleRecorder<T>::GetMaxSamples() const { + return max_samples_.load(std::memory_order_acquire); +} + } // namespace profiling_internal ABSL_NAMESPACE_END } // namespace absl |