mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-11-11 06:18:27 +01:00
compare chunks by timestamp
This commit is contained in:
1 parent
569bc7b54d
commit
d68b59ab4c
23 files changed
+138
-92
No files matched your search
@@ -42,6 +42,9 @@ 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++ {
|
||||
slab[i] = 0
|
||||
}
|
||||
return slab[:size]
|
||||
}
|
||||
return make([]byte, size)
|
||||
|
||||
Reference in new issue
Block a user