inline-rust icon indicating copy to clipboard operation
inline-rust copied to clipboard

Support function pointer types

Open harpocrates opened this issue 7 years ago • 2 comments

There is some trickiness around FunPtr and "dynamic" foreign imports.

See the docs on FunPtr for more information.

harpocrates avatar Nov 30 '17 09:11 harpocrates

These are now supported, but not automatically. Utilities are provided for automatically marshaling into and out of FunPtr. That said, it is on the user to free the FunPtr (in general, we have no way of knowing when there are no references to FunPtr on the Rust side).

harpocrates avatar Dec 05 '17 04:12 harpocrates

Before closing this issue, I have once more idea: let Rust take ownership of the function pointer! Here is a sketch of what the types might be on the Rust side. This doesn't mean nuking our existing function pointer approach, but it is a compelling alternative context.

harpocrates avatar May 15 '18 15:05 harpocrates