Closed
Description
Many functions with buffers take a void*
, for example https://en.cppreference.com/w/c/io/fread.
However, using a Uint8List
and .address
yields a Pointer<Uint8>
.
It would be useful to be able to pass uint8list.address.cast()
. That would prevent having to modify the FFIgen generated function signature.
Thanks for the suggestion @brianquinlan!
For anyone willing to contribute, the implementation is in:
sdk/pkg/vm/lib/modular/transformations/ffi/use_sites.dart
Lines 1489 to 1504 in 05d9e5b
The implementation should find the
cast()
invocation and use its receiver instead (effectively ignoring the cast expression as a no-op).