SWIG and callback wrappers
Anthony Green
green@redhat.com
Mon Apr 29 07:16:00 GMT 2002
On Mon, 2002-04-29 at 06:42, Sam Liddicott wrote:
> Reading through the source code I find that "trampoline"-"closures" are just
> what I need.
Great.
> Could I beg some examples on setting up and using closures?
> The old libff allowed:
> function = alloc_trampoline(address, variable, data);
> free_trampoline(function);
> is_trampoline(function)
> trampoline_address(function)
> trampoline_variable(function)
> trampoline_data(function)
The best examples I know of are in the GCJ runtime library. See
http://sources.redhat.com/java. You can download the latest snapshot of
the sources from here:
ftp://gcc.gnu.org/pub/gcc/snapshots
Be aware: The GCC sources contain a version of libffi which is probably
more stable than the cvs sources you're trying to build right now.
Those are definitely in flux and will eventually be imported back into
GCC.
> Are closures re-entrant?
Yes.
AG
More information about the Libffi-discuss
mailing list