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

Function getBuffer

pkg/sql/tokenizer/pool.go:37–39  ·  view source on GitHub ↗

getBuffer retrieves a buffer from the pool for internal use. The buffer is pre-allocated and ready for writing operations. Always pair with putBuffer() to return the buffer to the pool.

()

Source from the content-addressed store, hash-verified

35// The buffer is pre-allocated and ready for writing operations.
36// Always pair with putBuffer() to return the buffer to the pool.
37func getBuffer() *bytes.Buffer {
38 return bufferPool.Get().(*bytes.Buffer)
39}
40
41// putBuffer returns a buffer to the pool after use.
42// The buffer is reset (cleared) before being returned to the pool.

Callers 3

TokenizeMethod · 0.85
TokenizeContextMethod · 0.85
BenchmarkBufferPoolFunction · 0.85

Calls 1

GetMethod · 0.45

Tested by 1

BenchmarkBufferPoolFunction · 0.68