Revert "testing skip memory management"

This reverts commit 6c908352cb.
This commit is contained in:
chrislu 2022-01-17 03:21:31 -08:00
parent 6c908352cb
commit da7f13e73e

View file

@ -35,12 +35,10 @@ func getSlotPool(size int) *sync.Pool {
}
func Allocate(size int) []byte {
return make([]byte, size)
slab := *getSlotPool(size).Get().(*[]byte)
return slab[:size]
}
func Free(buf []byte) {
return
getSlotPool(cap(buf)).Put(&buf)
}