mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-29 06:35:07 +03:00
eliminate most sync.Pool use, gives a safer but slightly slower interface
This commit is contained in:
parent
9d0969db2b
commit
6d89570860
14 changed files with 53 additions and 96 deletions
|
@ -2,8 +2,6 @@ package yggdrasil
|
|||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/yggdrasil-network/yggdrasil-go/src/util"
|
||||
)
|
||||
|
||||
// TODO take max size from config
|
||||
|
@ -59,7 +57,7 @@ func (q *packetQueue) cleanup() {
|
|||
worstStream.infos = worstStream.infos[1:]
|
||||
worstStream.size -= uint64(len(packet))
|
||||
q.size -= uint64(len(packet))
|
||||
util.PutBytes(packet)
|
||||
pool_putBytes(packet)
|
||||
// save the modified stream to queues
|
||||
if len(worstStream.infos) > 0 {
|
||||
q.streams[worst] = worstStream
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue