diff options
| author | chrislu <chris.lu@gmail.com> | 2022-01-17 03:19:24 -0800 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-01-17 03:19:24 -0800 |
| commit | 6c908352cbc0791299b16c57815610204ea39f26 (patch) | |
| tree | 8f86ff3a79677dadf61d3d2c183c2e723b0cbed2 | |
| parent | 77d9993f38845ba3aa2af78a5f3d6ddb93093a48 (diff) | |
| download | seaweedfs-6c908352cbc0791299b16c57815610204ea39f26.tar.xz seaweedfs-6c908352cbc0791299b16c57815610204ea39f26.zip | |
testing skip memory management
| -rw-r--r-- | weed/util/mem/slot_pool.go | 2 |
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) } |
