[Cffi-devel] Callbacks & Lambdas

Luís Oliveira luismbo at gmail.com
Tue Nov 11 16:04:40 UTC 2014


On Mon, Nov 10, 2014 at 8:01 PM,  <Joerg-Cyril.Hoehle at t-systems.com> wrote:
> The issue with callbacks in CFFI is IMHO one of proper resource deallocation. No one AFAIK has devised a KISS-style lambda callback creation *AND DEALLOCATION* protocol. The reason why deallocation is important is that every lambda callback needs dynamic creation of what the CLISP libffi and GCC call a trampoline. The Lisp system cannot itself determine when the callback trampoline is not needed anymore, so the application MUST tell it.

<http://www.clisp.org/impnotes/dffi.html#dffi-callback-mem> suggests
that the trampolines for anonymous foreign callbacks are simply
leaked. Is that an accurate interpretation?

-- 
Luís Oliveira
http://kerno.org/~luis/




More information about the cffi-devel mailing list