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

Method Get

pkg/sql/tokenizer/buffer.go:74–78  ·  view source on GitHub ↗

Get retrieves a buffer from the pool. The returned buffer has zero length but may have capacity >= 128 bytes from previous use. This allows efficient appending without reallocation for typical SQL tokens. Thread Safety: Safe for concurrent calls. The buffer must be returned to the pool via Put()

()

Source from the content-addressed store, hash-verified

72//
73// Returns a byte slice ready for use (length 0, capacity >= 128).
74func (p *BufferPool) Get() []byte {
75 buf := p.pool.Get().(*[]byte)
76 *buf = (*buf)[:0] // Reset length but keep capacity
77 return *buf
78}
79
80// Put returns a buffer to the pool for reuse.
81//

Callers 15

TestBufferPoolFunction · 0.95
GetParserFunction · 0.45
toUpperFunction · 0.45
getBuilderFunction · 0.45
NewASTFunction · 0.45
GetInsertStatementFunction · 0.45
GetUpdateStatementFunction · 0.45
GetDeleteStatementFunction · 0.45
GetUpdateExpressionFunction · 0.45
GetSelectStatementFunction · 0.45
GetIdentifierFunction · 0.45
GetBinaryExpressionFunction · 0.45

Calls

no outgoing calls

Tested by 1

TestBufferPoolFunction · 0.76