mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-21 14:34:49 +01:00
net: Use DynamicUsage(m_type) in CSerializedNetMsg::GetMemoryUsage
Now that memusage correctly computes the dynamic size of a string, there is no need for special handling here.
This commit is contained in:
parent
c6594c0b14
commit
c3a6722f34
1 changed files with 1 additions and 4 deletions
|
@ -121,10 +121,7 @@ std::string strSubVersion;
|
||||||
|
|
||||||
size_t CSerializedNetMsg::GetMemoryUsage() const noexcept
|
size_t CSerializedNetMsg::GetMemoryUsage() const noexcept
|
||||||
{
|
{
|
||||||
// Don't count the dynamic memory used for the m_type string, by assuming it fits in the
|
return sizeof(*this) + memusage::DynamicUsage(m_type) + memusage::DynamicUsage(data);
|
||||||
// "small string" optimization area (which stores data inside the object itself, up to some
|
|
||||||
// size; 15 bytes in modern libstdc++).
|
|
||||||
return sizeof(*this) + memusage::DynamicUsage(data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CConnman::AddAddrFetch(const std::string& strDest)
|
void CConnman::AddAddrFetch(const std::string& strDest)
|
||||||
|
|
Loading…
Add table
Reference in a new issue