MCPcopy
hub / github.com/perkeep/perkeep / getBuf

Function getBuf

pkg/blob/ref.go:712–723  ·  view source on GitHub ↗
(size int)

Source from the content-addressed store, hash-verified

710var bufPool = make(chan []byte, 20)
711
712func getBuf(size int) []byte {
713 for {
714 select {
715 case b := <-bufPool:
716 if cap(b) >= size {
717 return b[:size]
718 }
719 default:
720 return make([]byte, size)
721 }
722 }
723}
724
725func putBuf(b []byte) {
726 select {

Callers 3

StringMethod · 0.70
StringMinusOneMethod · 0.70
DigestMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected