Track adds the given pointer to the list of pointers to track and returns a pointer value which can be passed to C as an opaque pointer.
(pointer interface{})
| 27 | // returns a pointer value which can be passed to C as an opaque |
| 28 | // pointer. |
| 29 | func (v *HandleList) Track(pointer interface{}) unsafe.Pointer { |
| 30 | handle := C.malloc(1) |
| 31 | |
| 32 | v.Lock() |
| 33 | v.handles[handle] = pointer |
| 34 | v.Unlock() |
| 35 | |
| 36 | return handle |
| 37 | } |
| 38 | |
| 39 | // Untrack stops tracking the pointer given by the handle |
| 40 | func (v *HandleList) Untrack(handle unsafe.Pointer) { |
no outgoing calls
no test coverage detected