Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
dart:ffi asFunction / lookupFunction static function vs instance method #35903
Pointer<Int8 Function(Int8)> p = fromAddress(memoryAddress); dynamic q = p; int Function(int) f = q.asFunction(); f(123);
Unfortunately we cannot at compile-time discover this, which means that we cannot generate trampolines in AOT mode.
We have two possible solutions:
The second option is a bit less ergonomic, but safer.