Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
53
func
(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
TestFuzzyByteSlicePools
Function · 0.80
TestReturnSliceSmallerThanMin
Function · 0.80
ReuseWriteRequest
Function · 0.80
ReuseWriteRequestV2
Function · 0.80
Calls
1
Put
Method · 0.65
Tested by
2
TestFuzzyByteSlicePools
Function · 0.64
TestReturnSliceSmallerThanMin
Function · 0.64