Skip to content

Commit

Permalink
allocate RouterInfo's buffer from pool
Browse files Browse the repository at this point in the history
  • Loading branch information
orignal committed Sep 18, 2024
1 parent a723405 commit ae26758
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libi2pd/RouterInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ namespace data
m_Caps (0), m_Version (0), m_Congestion (eLowCongestion)
{
m_Addresses = AddressesPtr(new Addresses ()); // create empty list
m_Buffer = NewBuffer (); // always RouterInfo's
m_Buffer = RouterInfo::NewBuffer (); // always RouterInfo's
ReadFromFile (fullPath);
}

Expand All @@ -74,7 +74,7 @@ namespace data
}

RouterInfo::RouterInfo (const uint8_t * buf, size_t len):
RouterInfo (std::make_shared<Buffer> (buf, len), len)
RouterInfo (netdb.NewRouterInfoBuffer (buf, len), len)
{
}

Expand Down

0 comments on commit ae26758

Please sign in to comment.