WIP: Morph: Add unit tests #2

Closed
dstepanov-yadro wants to merge 233 commits from TrueCloudLab/frostfs-node:master into object-3608-morph-unit-tests
Showing only changes of commit 0400153b7d - Show all commits

View file

@ -4,7 +4,10 @@ import (
"sync"
)
const defaultAllocSize = 1024
const (
defaultAllocSize = 1024
poolSliceMaxSize = 128 * 1024
)
type payload struct {
Data []byte
@ -19,6 +22,9 @@ func getPayload() *payload {
}
func putPayload(p *payload) {
if cap(p.Data) > poolSliceMaxSize {
return
}
p.Data = p.Data[:0]
putBytesPool.Put(p)
}