1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-17 18:06:15 -05:00
v2fly/transport/internet/quic/pool.go

24 lines
283 B
Go
Raw Normal View History

2019-02-01 14:08:21 -05:00
// +build !confonly
2018-11-21 10:47:06 -05:00
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
2018-11-21 10:47:06 -05:00
}