mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-12-01 19:06:42 +00:00
24 lines
271 B
Go
24 lines
271 B
Go
// +build !confonly
|
|
|
|
package quic
|
|
|
|
import (
|
|
"sync"
|
|
|
|
"github.com/xtls/xray-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)
|
|
}
|