aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-01-17 03:19:24 -0800
committerchrislu <chris.lu@gmail.com>2022-01-17 03:19:24 -0800
commit6c908352cbc0791299b16c57815610204ea39f26 (patch)
tree8f86ff3a79677dadf61d3d2c183c2e723b0cbed2
parent77d9993f38845ba3aa2af78a5f3d6ddb93093a48 (diff)
downloadseaweedfs-6c908352cbc0791299b16c57815610204ea39f26.tar.xz
seaweedfs-6c908352cbc0791299b16c57815610204ea39f26.zip
testing skip memory management
-rw-r--r--weed/util/mem/slot_pool.go2
1 files changed, 2 insertions, 0 deletions
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)
}