static ffi.Pointer<ffi.Void> toPointer(Point? val) { if (val == null) { return ffi.nullptr; } final result = malloc.call<PointNative>(); result.ref = toNative(val); return result.cast(); }