brontide+peer: use internal sync/pool to reduce allocations
This ensures that under medium to high load, we eliminate all allocations once we arrive a steady state, re working memory.
This commit is contained in:
3 files changed
+93
-6
No files matched your search
@@ -287,3 +287,10 @@ func (c *Conn) RemotePub() *btcec.PublicKey {
|
||||
func (c *Conn) LocalPub() *btcec.PublicKey {
|
||||
return c.noise.localStatic.PubKey()
|
||||
}
|
||||
|
||||
// ClearPendingSend drops references to the next header and body buffers and
|
||||
// returns any pooled buffers back to their respective pools so that the memory
|
||||
// can be reused.
|
||||
func (c *Conn) ClearPendingSend() {
|
||||
c.noise.releaseBuffers()
|
||||
}
|
||||
Reference in new issue
Block a user