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:
1 parent
c6594c0b14
commit
c3a6722f34
1 file changed
+1
-4
+1
-4
@@ -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)
|
||||||
|
|||||||
Reference in new issue
Block a user