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

Method reuseSlice

pkg/cortexpb/slicesPool.go:53–61  ·  view source on GitHub ↗
(s *[]byte)

Source from the content-addressed store, hash-verified

51}
52
53func (sp *byteSlicePools) reuseSlice(s *[]byte) {
54 index := int(math.Floor(math.Log2(float64(cap(*s))))) - minPoolSizePower
55
56 if index >= len(sp.pools) || index < 0 {
57 return
58 }
59
60 sp.pools[index].Put(s)
61}

Callers 4

TestFuzzyByteSlicePoolsFunction · 0.80
ReuseWriteRequestFunction · 0.80
ReuseWriteRequestV2Function · 0.80

Calls 1

PutMethod · 0.65

Tested by 2

TestFuzzyByteSlicePoolsFunction · 0.64