mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
fix slab clearing error
This commit is contained in:
parent
d68b59ab4c
commit
b7d30812fc
|
@ -42,7 +42,7 @@ func getSlotPool(size int) (*sync.Pool, bool) {
|
|||
func Allocate(size int) []byte {
|
||||
if pool, found := getSlotPool(size); found {
|
||||
slab := *pool.Get().(*[]byte)
|
||||
for i := 0; i < size; i++ {
|
||||
for i, _ := range slab {
|
||||
slab[i] = 0
|
||||
}
|
||||
return slab[:size]
|
||||
|
|
Loading…
Reference in a new issue