MCPcopy
hub / github.com/CodisLabs/codis / MakeSlice

Function MakeSlice

pkg/utils/unsafe2/slice.go:31–38  ·  view source on GitHub ↗
(n int)

Source from the content-addressed store, hash-verified

29const MinOffheapSlice = 1024 * 16
30
31func MakeSlice(n int) Slice {
32 if n >= MinOffheapSlice {
33 if s := newCGoSlice(n, false); s != nil {
34 return s
35 }
36 }
37 return newGoSlice(n)
38}
39
40func MakeOffheapSlice(n int) Slice {
41 if n >= 0 {

Callers 2

TestMakeGoSliceFunction · 0.85
TestMakeCGoSliceFunction · 0.85

Calls 2

newCGoSliceFunction · 0.85
newGoSliceFunction · 0.85

Tested by 2

TestMakeGoSliceFunction · 0.68
TestMakeCGoSliceFunction · 0.68