mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-11-25 06:36:05 +03:00
22 lines
250 B
Go
22 lines
250 B
Go
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)
|
|
}
|