MCPcopy Create free account
hub / github.com/valyala/bytebufferpool / testGetPut

Function testGetPut

pool_test.go:79–86  ·  view source on GitHub ↗
(t *testing.T, n int)

Source from the content-addressed store, hash-verified

77}
78
79func testGetPut(t *testing.T, n int) {
80 bb := Get()
81 if len(bb.B) > 0 {
82 t.Fatalf("non-empty byte buffer returned from acquire")
83 }
84 bb.B = allocNBytes(bb.B, n)
85 Put(bb)
86}
87
88func allocNBytes(dst []byte, n int) []byte {
89 diff := n - cap(dst)

Callers 2

TestPoolCalibrateFunction · 0.85
testPoolVariousSizesFunction · 0.85

Calls 3

GetFunction · 0.85
allocNBytesFunction · 0.85
PutFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…