[cffi-devel] Re: first clisp-specific patch: copyright, callbacks & spam

Luís Oliveira luismbo at gmail.com
Thu Dec 22 12:56:55 UTC 2005


"Hoehle, Joerg-Cyril" <Joerg-Cyril.Hoehle at t-systems.com> writes:
>>> ffi:memory-as is a perfect match for %mem-ref
>>Sure, sure. We would have used it if it were documented. ;-)
> You didn't read the documentation recently, did you?

Heh. :-)


>> Something like this?
>>+       (let ((cb-fun (get ',name 'clisp-callback-function)))
>>+         (when cb-fun (ffi:foreign-free cb-fun)))
>>+       (setf (get ',name 'clisp-callback-function) ,cb-var)
> The comments specifically meant that this would not work, because
> (foreign-free #.#<FOREIGN-ADDRESS>) -> free(), which is not appropriate,
> while
> (foreign-free #.#<FOREIGN-FUNCTION>) lets clisp recognize and free the
> function.

Yes, exactly. And (type-of cb-var) => FFI:FOREIGN-FUNCTION.

CFFI> (defcallback foo :void ())
FOO
CFFI> (get 'foo 'cffi-sys::clisp-callback-function)
#<FOREIGN-FUNCTION #x004005E4>
CFFI> (ffi:foreign-free *)
NIL


>>If so, could these symbols CFFI uses be exported?
> I'm looking into that.

Thanks!

-- 
Luís Oliveira
luismbo (@) gmail (.) com
Equipa Portuguesa do Translation Project
http://www.iro.umontreal.ca/translation/registry.cgi?team=pt




More information about the cffi-devel mailing list