MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / allocBytes

Method allocBytes

pkg/sql/parser/scan.go:59–66  ·  view source on GitHub ↗
(length int)

Source from the content-addressed store, hash-verified

57}
58
59func (s *scanner) allocBytes(length int) []byte {
60 if len(s.bytesPrealloc) >= length {
61 res := s.bytesPrealloc[:length:length]
62 s.bytesPrealloc = s.bytesPrealloc[length:]
63 return res
64 }
65 return make([]byte, length)
66}
67
68// buffer returns an empty []byte buffer that can be appended to. Any unused
69// portion can be returned later using returnBuffer.

Callers 1

scanIdentMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected