MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / Put

Method Put

pkg/sql/tokenizer/buffer.go:92–96  ·  view source on GitHub ↗

Put returns a buffer to the pool for reuse. The buffer's capacity is preserved, allowing it to be reused for similarly-sized operations without reallocation. Buffers with zero capacity are discarded. Thread Safety: Safe for concurrent calls. It's safe to call Put multiple times with the same buff

(buf []byte)

Source from the content-addressed store, hash-verified

90// Parameters:
91// - buf: The byte slice to return to the pool
92func (p *BufferPool) Put(buf []byte) {
93 if cap(buf) > 0 {
94 p.pool.Put(&buf)
95 }
96}
97
98// Grow ensures the buffer has enough capacity for n additional bytes.
99//

Callers 15

TestBufferPoolFunction · 0.95
GrowMethod · 0.95
PutParserFunction · 0.80
toUpperFunction · 0.80
putBuilderFunction · 0.80
ReleaseASTFunction · 0.80
PutInsertStatementFunction · 0.80
PutUpdateStatementFunction · 0.80
PutDeleteStatementFunction · 0.80
PutUpdateExpressionFunction · 0.80
PutSelectStatementFunction · 0.80
PutIdentifierFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestBufferPoolFunction · 0.76