Browse Source

testing skip memory management

pull/2596/head
chrislu 3 years ago
parent
commit
6c908352cb
  1. 2
      weed/util/mem/slot_pool.go

2
weed/util/mem/slot_pool.go

@ -35,10 +35,12 @@ 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)
}
Loading…
Cancel
Save