mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-11-29 05:49:03 +08:00
testing skip memory management
This commit is contained in:
parent
77d9993f38
commit
6c908352cb
@ -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…
Reference in New Issue
Block a user