mirror of
https://github.com/octoleo/restic.git
synced 2024-11-23 13:17:42 +00:00
22 lines
274 B
Go
22 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)
|
|
}
|