2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-04 20:37:49 +00:00
restic/repo/pool.go
2015-05-09 13:24:15 +02:00

22 lines
275 B
Go

package repo
import (
"sync"
"github.com/restic/restic/chunker"
)
var bufPool = sync.Pool{
New: func() interface{} {
return make([]byte, chunker.MinSize)
},
}
func getBuf() []byte {
return bufPool.Get().([]byte)
}
func freeBuf(data []byte) {
bufPool.Put(data)
}