[vm/ffi] Support freeing Pointer.fromFunction
trampolines
#50610
Labels
area-vm
Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
library-ffi
Currently, we never free these trampolines. The argument being that we hand out a pointer to C and we don't know when C is done.
However, in C use cases where the user knows when they are done with it, they currently have no way to free the trampoline.
In Java (with
Runnable
) and ObjectiveC (withBlock
), we do know when we're done with a callback. Consequently,package:jnigen
andpackage:ffigen
could generate the calls to free the trampolines.The text was updated successfully, but these errors were encountered: