MCPcopy Create free account
hub / github.com/cortexproject/cortex / PreallocTimeseriesSliceFromPool

Function PreallocTimeseriesSliceFromPool

pkg/cortexpb/timeseries.go:312–314  ·  view source on GitHub ↗

PreallocTimeseriesSliceFromPool retrieves a slice of PreallocTimeseries from a sync.Pool. ReuseSlice should be called once done.

()

Source from the content-addressed store, hash-verified

310// PreallocTimeseriesSliceFromPool retrieves a slice of PreallocTimeseries from a sync.Pool.
311// ReuseSlice should be called once done.
312func PreallocTimeseriesSliceFromPool() []PreallocTimeseries {
313 return slicePool.Get().([]PreallocTimeseries)
314}
315
316// ReuseSlice puts the slice back into a sync.Pool for reuse.
317func ReuseSlice(ts []PreallocTimeseries) {

Calls 1

GetMethod · 0.65