File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change 22// Distributed under the MIT software license, see the accompanying
33// file COPYING or https://opensource.org/license/mit/.
44
5+ #include < memusage.h>
56#include < span.h>
67#include < streams.h>
78#include < util/fs_helpers.h>
@@ -110,3 +111,8 @@ bool AutoFile::Truncate(unsigned size)
110111{
111112 return ::TruncateFile (m_file, size);
112113}
114+
115+ size_t DataStream::GetMemoryUsage () const noexcept
116+ {
117+ return sizeof (*this ) + memusage::DynamicUsage (vch);
118+ }
Original file line number Diff line number Diff line change @@ -277,6 +277,9 @@ class DataStream
277277 {
278278 util::Xor (MakeWritableByteSpan (*this ), MakeByteSpan (key));
279279 }
280+
281+ /* * Compute total memory usage of this object (own memory + any dynamic memory). */
282+ size_t GetMemoryUsage () const noexcept ;
280283};
281284
282285template <typename IStream>
You can’t perform that action at this time.
0 commit comments