mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-11-19 02:46:33 -05:00
24 lines
260 B
Go
24 lines
260 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)
|
|
}
|