github.com/eagleql/xray-core@v1.4.4/transport/internet/quic/pool.go (about) 1 package quic 2 3 import ( 4 "sync" 5 6 "github.com/eagleql/xray-core/common/bytespool" 7 ) 8 9 var pool *sync.Pool 10 11 func init() { 12 pool = bytespool.GetPool(2048) 13 } 14 15 func getBuffer() []byte { 16 return pool.Get().([]byte) 17 } 18 19 func putBuffer(p []byte) { 20 pool.Put(p) 21 }