restic/internal/repository/pool.go
Alexander Neumann 83d1a46526 Moves files
2017-07-23 14:19:13 +02:00

21 lines
274 B
Go

package repository
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)
}