MCPcopy Create free account
hub / github.com/dolthub/doltgresql / allocBytes

Method allocBytes

postgres/parser/parser/scan.go:73–80  ·  view source on GitHub ↗
(length int)

Source from the content-addressed store, hash-verified

71}
72
73func (s *scanner) allocBytes(length int) []byte {
74 if len(s.bytesPrealloc) >= length {
75 res := s.bytesPrealloc[:length:length]
76 s.bytesPrealloc = s.bytesPrealloc[length:]
77 return res
78 }
79 return make([]byte, length)
80}
81
82// buffer returns an empty []byte buffer that can be appended to. Any unused
83// portion can be returned later using returnBuffer.

Callers 1

scanIdentMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected