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

Function LoadPointer

gapis/memory/load.go:43–53  ·  view source on GitHub ↗

LoadPointer loads the element from p.

(ctx context.Context, p Pointer, pools Pools, l *device.MemoryLayout)

Source from the content-addressed store, hash-verified

41
42// LoadPointer loads the element from p.
43func LoadPointer(ctx context.Context, p Pointer, pools Pools, l *device.MemoryLayout) (interface{}, error) {
44 ioR := pools.ApplicationPool().At(p.Address()).NewReader(ctx)
45 binR := endian.Reader(ioR, l.GetEndian())
46 d := NewDecoder(binR, l)
47 elPtr := reflect.New(p.ElementType())
48 Read(d, elPtr.Interface())
49 if err := binR.Error(); err != nil {
50 return nil, err
51 }
52 return elPtr.Elem().Interface(), nil
53}

Callers

nothing calls this directly

Calls 11

NewDecoderFunction · 0.85
ApplicationPoolMethod · 0.80
InterfaceMethod · 0.80
ReadFunction · 0.70
NewReaderMethod · 0.65
AddressMethod · 0.65
ReaderMethod · 0.65
NewMethod · 0.65
ElementTypeMethod · 0.65
ErrorMethod · 0.65
AtMethod · 0.45

Tested by

no test coverage detected