MCPcopy
hub / github.com/jackc/pgx / Put

Function Put

internal/iobufpool/iobufpool.go:54–61  ·  view source on GitHub ↗

Put returns buf to the pool.

(buf *[]byte)

Source from the content-addressed store, hash-verified

52
53// Put returns buf to the pool.
54func Put(buf *[]byte) {
55 i := putPoolIdx(cap(*buf))
56 if i < 0 {
57 return
58 }
59
60 pools[i].Put(buf)
61}
62
63func putPoolIdx(size int) int {
64 // Only exact power-of-2 sizes match pool buckets

Callers 5

NextMethod · 0.92
TestPutGetBufferReuseFunction · 0.92
CopyFromMethod · 0.92
readFromReadResultsMethod · 0.92

Calls 2

putPoolIdxFunction · 0.85
PutMethod · 0.65

Tested by 2

TestPutGetBufferReuseFunction · 0.74