2
2
mirror of https://github.com/octoleo/restic.git synced 2024-09-22 19:59:02 +00:00
restic/src/restic/buffer_pool.go
2016-02-23 23:14:35 +01:00

22 lines
270 B
Go

package restic
import (
"sync"
"github.com/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)
}