frostfs-node/pkg/services/object/put/pool.go
Alejandro Lopez cb5468abb8 [#66] node: Replace interface{} with any
Signed-off-by: Alejandro Lopez <a.lopez@yadro.com>
2023-02-21 16:47:07 +03:00

20 lines
307 B
Go

package putsvc
import (
"sync"
)
const defaultAllocSize = 1024
var putBytesPool = &sync.Pool{
New: func() any { return make([]byte, 0, defaultAllocSize) },
}
func getPayload() []byte {
return putBytesPool.Get().([]byte)
}
func putPayload(p []byte) {
//nolint:staticcheck
putBytesPool.Put(p[:0])
}