MCPcopy Create free account
hub / github.com/segmentio/encoding / pointerDecodeFuncOf

Function pointerDecodeFuncOf

proto/pointer.go:43–52  ·  view source on GitHub ↗
(t reflect.Type, c *codec)

Source from the content-addressed store, hash-verified

41}
42
43func pointerDecodeFuncOf(t reflect.Type, c *codec) decodeFunc {
44 t = t.Elem()
45 return func(b []byte, p unsafe.Pointer, flags flags) (int, error) {
46 v := (*unsafe.Pointer)(p)
47 if *v == nil {
48 *v = unsafe.Pointer(reflect.New(t).Pointer())
49 }
50 return c.decode(b, *v, flags)
51 }
52}

Callers 1

pointerCodecOfFunction · 0.85

Calls 2

decodeMethod · 0.80
ElemMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…