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

Method newString

pkg/sql/sem/tree/datum_alloc.go:218–232  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

216}
217
218func (a *DatumAlloc) newString() *string {
219 buf := &a.stringAlloc
220 if len(*buf) == 0 {
221 allocSize := defaultDatumAllocSize
222 if a.typeAllocSizes.strings != 0 {
223 allocSize = a.typeAllocSizes.strings
224 } else if a.DefaultAllocSize != 0 {
225 allocSize = a.DefaultAllocSize
226 }
227 *buf = make([]string, allocSize)
228 }
229 r := &(*buf)[0]
230 *buf = (*buf)[1:]
231 return r
232}
233
234// NewDString allocates a DString.
235func (a *DatumAlloc) NewDString(v DString) *DString {

Callers 3

NewDStringMethod · 0.95
NewDBytesMethod · 0.95
NewDEncodedKeyMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected