Files
kubevpn/core/pool.go
2022-02-28 11:46:21 +08:00

25 lines
396 B
Go

package core
import (
"github.com/wencaiwulue/kubevpn/config"
"sync"
)
var (
SPool = &sync.Pool{
New: func() interface{} {
return make([]byte, config.SmallBufferSize)
},
}
MPool = &sync.Pool{
New: func() interface{} {
return make([]byte, config.MediumBufferSize)
},
}
LPool = &sync.Pool{
New: func() interface{} {
return make([]byte, config.LargeBufferSize)
},
}
)