aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorlaanwj <126646+laanwj@users.noreply.github.com>2024-11-04 18:26:06 +0100
committerlaanwj <126646+laanwj@users.noreply.github.com>2024-11-04 18:46:40 +0100
commitc3a6722f34a575834b282894d441d7bf802bd467 (patch)
tree7c6abf55a6ee5ad480c37f2ddee390f272adfd0a /src/net.cpp
parentc6594c0b142133535c1d2d5b8d8084cf9e57592b (diff)
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.
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/net.cpp b/src/net.cpp
index d76b39f75d..3e936b5f3d 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -121,10 +121,7 @@ std::string strSubVersion;
size_t CSerializedNetMsg::GetMemoryUsage() const noexcept
{
- // Don't count the dynamic memory used for the m_type string, by assuming it fits in the
- // "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);
+ return sizeof(*this) + memusage::DynamicUsage(m_type) + memusage::DynamicUsage(data);
}
void CConnman::AddAddrFetch(const std::string& strDest)