mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2024-11-15 05:31:18 +08:00
17 lines
368 B
Go
17 lines
368 B
Go
package pool
|
|
|
|
const (
|
|
// io.Copy default buffer size is 32 KiB
|
|
// but the maximum packet size of vmess/shadowsocks is about 16 KiB
|
|
// so define a buffer of 20 KiB to reduce the memory of each TCP relay
|
|
RelayBufferSize = 20 * 1024
|
|
)
|
|
|
|
func Get(size int) []byte {
|
|
return defaultAllocator.Get(size)
|
|
}
|
|
|
|
func Put(buf []byte) error {
|
|
return defaultAllocator.Put(buf)
|
|
}
|