memory pool for IdentityEx

This commit is contained in:
orignal 2023-03-16 21:32:53 -04:00
parent 5ad9c8e740
commit 55b2f2c625
7 changed files with 46 additions and 67 deletions

View file

@ -50,7 +50,7 @@ namespace data
void LeaseSet::ReadFromBuffer (bool readIdentity, bool verifySignature)
{
if (readIdentity || !m_Identity)
m_Identity = std::make_shared<IdentityEx>(m_Buffer, m_BufferLen);
m_Identity = netdb.NewIdentity (m_Buffer, m_BufferLen);
size_t size = m_Identity->GetFullLen ();
if (size + 256 > m_BufferLen)
{
@ -317,7 +317,7 @@ namespace data
std::shared_ptr<const IdentityEx> identity;
if (readIdentity || !GetIdentity ())
{
identity = std::make_shared<IdentityEx>(buf, len);
identity = netdb.NewIdentity (buf, len);
SetIdentity (identity);
}
else