mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 14:53:43 +01:00
streams: add DataStream::GetMemoryUsage
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or https://opensource.org/license/mit/.
|
||||
|
||||
#include <memusage.h>
|
||||
#include <span.h>
|
||||
#include <streams.h>
|
||||
#include <util/fs_helpers.h>
|
||||
@@ -110,3 +111,8 @@ bool AutoFile::Truncate(unsigned size)
|
||||
{
|
||||
return ::TruncateFile(m_file, size);
|
||||
}
|
||||
|
||||
size_t DataStream::GetMemoryUsage() const noexcept
|
||||
{
|
||||
return sizeof(*this) + memusage::DynamicUsage(vch);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user