mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2026-05-21 13:26:29 +03:00
eliminate most sync.Pool use, gives a safer but slightly slower interface
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user