LoadPointer loads the element from p.
(ctx context.Context, p Pointer, pools Pools, l *device.MemoryLayout)
| 41 | |
| 42 | // LoadPointer loads the element from p. |
| 43 | func 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 | } |
nothing calls this directly
no test coverage detected