MCPcopy Create free account
hub / github.com/google/gapid / New

Function New

core/data/slice/slice.go:25–29  ·  view source on GitHub ↗

New returns a new addressable slice value of type ty.

(ty reflect.Type, len, cap int)

Source from the content-addressed store, hash-verified

23
24// New returns a new addressable slice value of type ty.
25func New(ty reflect.Type, len, cap int) reflect.Value {
26 ptr := reflect.New(ty)
27 ptr.Elem().Set(reflect.MakeSlice(ty, len, cap))
28 return ptr.Elem()
29}
30
31// Replace replaces count elements of s starting from first with with.
32// s must be a pointer to a slice.

Callers 3

RemoveFunction · 0.70
RemoveAtFunction · 0.70
CloneFunction · 0.70

Calls 3

MakeSliceMethod · 0.80
NewMethod · 0.65
SetMethod · 0.65

Tested by

no test coverage detected