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

Function PutTokenizer

pkg/sql/tokenizer/pool.go:129–138  ·  view source on GitHub ↗

PutTokenizer returns a Tokenizer instance to the pool for reuse. This must be called after you're done with a Tokenizer obtained from GetTokenizer() to enable instance reuse and prevent memory leaks. The tokenizer is automatically reset before being returned to the pool, clearing all state includi

(t *Tokenizer)

Source from the content-addressed store, hash-verified

127// - Debug logger cleared
128// - Keywords preserved (immutable configuration)
129func PutTokenizer(t *Tokenizer) {
130 if t != nil {
131 t.Reset()
132 tokenizerPool.Put(t)
133
134 // Record pool return
135 metrics.RecordPoolPut()
136 metrics.RecordNamedPoolPut("tokenizer")
137 }
138}
139
140// Reset clears a Tokenizer's state for reuse while preserving allocated memory.
141//

Callers 15

LintStringMethod · 0.92
makeCtxFunction · 0.92
makeCtxFunction · 0.92
makeContextFunction · 0.92
testSQLFileFunction · 0.92
parseSQLFunction · 0.92

Calls 4

RecordPoolPutFunction · 0.92
RecordNamedPoolPutFunction · 0.92
PutMethod · 0.80
ResetMethod · 0.45

Tested by 15

makeCtxFunction · 0.74
makeCtxFunction · 0.74
makeContextFunction · 0.74
testSQLFileFunction · 0.74
parseSQLFunction · 0.74