This is the mail archive of the libffi-discuss@sources.redhat.com mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: SWIG and callback wrappers


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]