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

Method allocBytes

pkg/sql/scanner/scan.go:111–118  ·  view source on GitHub ↗
(length int)

Source from the content-addressed store, hash-verified

109}
110
111func (s *Scanner) allocBytes(length int) []byte {
112 if cap(s.bytesPrealloc) >= length {
113 res := s.bytesPrealloc[:length:length]
114 s.bytesPrealloc = s.bytesPrealloc[length:cap(s.bytesPrealloc)]
115 return res
116 }
117 return make([]byte, length)
118}
119
120// buffer returns an empty []byte buffer that can be appended to. Any unused
121// portion can be returned later using returnBuffer.

Callers 1

normalizeIdentMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected