From 6c908352cbc0791299b16c57815610204ea39f26 Mon Sep 17 00:00:00 2001 From: chrislu Date: Mon, 17 Jan 2022 03:19:24 -0800 Subject: [PATCH] testing skip memory management --- weed/util/mem/slot_pool.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/weed/util/mem/slot_pool.go b/weed/util/mem/slot_pool.go index e6680d3cb..a871188b5 100644 --- a/weed/util/mem/slot_pool.go +++ b/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) }