From 056ab199abb302297529812834e4f36a1d91149c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 21 Jan 2021 16:44:11 +0100 Subject: [PATCH] util/PeakBuffer: add method max_size() --- src/util/PeakBuffer.hxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/util/PeakBuffer.hxx b/src/util/PeakBuffer.hxx index c3d871035..febf8bd73 100644 --- a/src/util/PeakBuffer.hxx +++ b/src/util/PeakBuffer.hxx @@ -55,6 +55,10 @@ public: PeakBuffer(const PeakBuffer &) = delete; PeakBuffer &operator=(const PeakBuffer &) = delete; + std::size_t max_size() const noexcept { + return normal_size + peak_size; + } + gcc_pure bool empty() const noexcept;