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 2
2
// Distributed under the MIT software license, see the accompanying
3
3
// file COPYING or https://opensource.org/license/mit/.
4
4
5
+ #include < memusage.h>
5
6
#include < span.h>
6
7
#include < streams.h>
7
8
#include < util/fs_helpers.h>
@@ -110,3 +111,8 @@ bool AutoFile::Truncate(unsigned size)
110
111
{
111
112
return ::TruncateFile (m_file, size);
112
113
}
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
277
277
{
278
278
util::Xor (MakeWritableByteSpan (*this ), MakeByteSpan (key));
279
279
}
280
+
281
+ /* * Compute total memory usage of this object (own memory + any dynamic memory). */
282
+ size_t GetMemoryUsage () const noexcept ;
280
283
};
281
284
282
285
template <typename IStream>
You can’t perform that action at this time.
0 commit comments