MCPcopy Index your code
hub / github.com/go-git/go-git / GetByteSlice

Function GetByteSlice

utils/sync/bytes.go:27–30  ·  view source on GitHub ↗

GetByteSlice returns a *[]byte that is managed by a sync.Pool. The initial slice length will be 16384 (16kb). After use, the *[]byte should be put back into the sync.Pool by calling PutByteSlice.

()

Source from the content-addressed store, hash-verified

25// After use, the *[]byte should be put back into the sync.Pool
26// by calling PutByteSlice.
27func GetByteSlice() *[]byte {
28 buf := byteSlice.Get().(*[]byte)
29 return buf
30}
31
32// PutByteSlice puts buf back into its sync.Pool.
33func PutByteSlice(buf *[]byte) {

Callers 7

checkoutFileMethod · 0.92
copyObjectMethod · 0.92
CloseMethod · 0.92
ApplyDeltaFunction · 0.92
patchDeltaWriterFunction · 0.92
TestGetAndPutByteSliceFunction · 0.85
GetZlibReaderFunction · 0.85

Calls 1

GetMethod · 0.65

Tested by 1

TestGetAndPutByteSliceFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…