mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-11-10 06:16:53 -05:00
c78ee5aac7
* ⬆ Update to Go 1.17 * 🏗 Update workflows and add windows-arm64 * 💾 Update generated files * 📛 Update not-so-friendly filenames
25 lines
320 B
Go
25 lines
320 B
Go
//go:build !confonly
|
|
// +build !confonly
|
|
|
|
package quic
|
|
|
|
import (
|
|
"sync"
|
|
|
|
"github.com/v2fly/v2ray-core/v4/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
|
|
}
|