Improve: pool buffer alloc

This commit is contained in:
Dreamacro
2020-04-25 00:30:40 +08:00
parent 2b33bfae6b
commit 0e56c195bb
12 changed files with 158 additions and 48 deletions

View File

@ -33,6 +33,6 @@ func (c *packet) LocalAddr() net.Addr {
}
func (c *packet) Drop() {
pool.BufPool.Put(c.bufRef[:cap(c.bufRef)])
pool.Put(c.bufRef)
return
}