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

Function PutParser

pkg/sql/parser/parser.go:105–111  ·  view source on GitHub ↗

PutParser returns a Parser instance to the pool after resetting it. This MUST be called after parsing is complete to enable reuse and prevent memory leaks. The parser is automatically reset before being returned to the pool, clearing all internal state (tokens, position, depth, context, position ma

(p *Parser)

Source from the content-addressed store, hash-verified

103//
104// Thread Safety: Safe for concurrent calls - operates on independent parser instances.
105func PutParser(p *Parser) {
106 if p != nil {
107 p.Reset()
108 parserPool.Put(p)
109 metrics.RecordNamedPoolPut("parser")
110 }
111}
112
113// Reset clears the parser state for reuse from the pool.
114func (p *Parser) Reset() {

Callers 15

parseExpectErrorFunction · 0.92
parseWithPositionsFunction · 0.92
ParseFunction · 0.92
ParseWithContextFunction · 0.92
ParseMultipleFunction · 0.92
ValidateMultipleFunction · 0.92
ParseWithRecoveryFunction · 0.92
NormalizeFunction · 0.92

Calls 3

RecordNamedPoolPutFunction · 0.92
PutMethod · 0.80
ResetMethod · 0.45