Xray-core/transport/internet/quic/pool.go
2020-11-25 19:01:53 +08:00

24 lines
274 B
Go

// +build !confonly
package quic
import (
"sync"
"github.com/xtls/xray-core/v1/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)
}