compare chunks by timestamp

This commit is contained in:
chrislu committed 2022-12-22 20:39:24 -08:00
1 parent 569bc7b54d
commit d68b59ab4c
23 files changed
+138 -92

No files matched your search

+3
View File
@@ -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)