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

Function GetParser

pkg/sql/parser/parser.go:86–89  ·  view source on GitHub ↗

GetParser returns a Parser instance from the pool. The caller MUST call PutParser when done to return it to the pool. This function is thread-safe and designed for concurrent use. Each goroutine should get its own parser instance from the pool. Performance: O(1) amortized, <50ns typical latency U

()

Source from the content-addressed store, hash-verified

84//
85// Thread Safety: Safe for concurrent calls - each goroutine gets its own instance.
86func GetParser() *Parser {
87 metrics.RecordNamedPoolGet("parser")
88 return parserPool.Get().(*Parser)
89}
90
91// PutParser returns a Parser instance to the pool after resetting it.
92// This MUST be called after parsing is complete to enable reuse and prevent memory leaks.

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 2

RecordNamedPoolGetFunction · 0.92
GetMethod · 0.45