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

Function GetBytesBuffer

utils/sync/bytes.go:42–46  ·  view source on GitHub ↗

GetBytesBuffer returns a *bytes.Buffer that is managed by a sync.Pool. Returns a buffer that is reset and ready for use. After use, the *bytes.Buffer should be put back into the sync.Pool by calling PutBytesBuffer.

()

Source from the content-addressed store, hash-verified

40// After use, the *bytes.Buffer should be put back into the sync.Pool
41// by calling PutBytesBuffer.
42func GetBytesBuffer() *bytes.Buffer {
43 buf := bytesBuffer.Get().(*bytes.Buffer)
44 buf.Reset()
45 return buf
46}
47
48// PutBytesBuffer puts buf back into its sync.Pool.
49func PutBytesBuffer(buf *bytes.Buffer) {

Callers 12

getDeltaFunction · 0.92
diffDeltaFunction · 0.92
indexObjectsMethod · 0.92
resolveDeltasMethod · 0.92
getMethod · 0.92
resolveObjectMethod · 0.92
getObjectSizeMethod · 0.92
getNextObjectMethod · 0.92
ApplyDeltaFunction · 0.92
TestGetAndPutBytesBufferFunction · 0.85

Calls 2

GetMethod · 0.65
ResetMethod · 0.45

Tested by 1

TestGetAndPutBytesBufferFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…