1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-07-01 03:25:23 +00:00
v2fly/transport/internet/quic/pool.go
2020-11-22 05:05:01 +08:00

24 lines
283 B
Go

// +build !confonly
package quic
import (
"sync"
"v2ray.com/core/common/bytespool"
)
var pool *sync.Pool
func init() {
pool = bytespool.GetPool(2048)
}
func getBuffer() []byte {
return pool.Get().([]byte)
}
func putBuffer(p []byte) {
pool.Put(p) // nolint: staticcheck
}