chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] SWIG and callbacks


From: Tony Sidaway
Subject: [Chicken-users] SWIG and callbacks
Date: Sat, 3 Mar 2007 14:22:03 +0000

I'm trying to write a callback in Scheme.  The unusual thing about
this callback is that it's intended to be invoked during the course of
a Swig call.

I know that our native FFI has foreign-lambda and foreign-safe-lambda,
the latter intended for this kind of circumstance.  My question is:
does Chicken Swig also permit this, or would I have to rewrite the
swig code to make it safe for callbacks?

Examining the Scheme code for "create-foreign-stub", which generates
all foreign calls in the Chicken ffi, it seems that what needs to be
done before a "safe"  or what was formerly known as a "callback" call,
boils down to the following:

* make 24 bytes more space for the result type
* perform a minor garbage collection.

I suppose I could add these to my swig-generated stubs and see what
happens, but I thought I'd ask first in case somebody knows.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]