use<R> method
Invokes fn with the underlying Pointer<T>, keeping this reachable
until fn completes so the GC finalizer cannot run mid-call.
Implementation
R use<R>(R Function(ffi.Pointer<T> ptr) fn) {
if (_disposed) {
throw StateError('NativeHandle<$T> has already been disposed');
}
return fn(_ptr);
}