FYI, a forward of a few patches I sent to the cffi-devel maling list. I feel there is a lot of room for improvement using compiler macros: the result might be a much leaner version of the code, with almost everything inlined when using the C compiler.<br>

<br>The only problem is that the code generated by CFFI still relies on its own runtime, methods, classes and other stuff that it does not resolve at compilation time. I find this is unfortunate, but I do not have the time to dig deeper into the library: my investigations are just focused around cffi-ecl.lisp<br>

<br>Juanjo<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Juan Jose Garcia-Ripoll</b> <span dir="ltr"><<a href="mailto:juanjose.garciaripoll@googlemail.com">juanjose.garciaripoll@googlemail.com</a>></span><br>

Date: Sun, Apr 25, 2010 at 2:47 PM<br>Subject: ECL specific changes for CFFI<br>To: <a href="mailto:cffi-devel@common-lisp.net">cffi-devel@common-lisp.net</a><br><br><br>* The former definition for :long-long types in cffi-ecl.lisp was 
broken. I have agumented ECL with a feature that signals the existence 
of such a type in ECL and include a patch here for CFFI to take that 
into account. (Patch attached)<br clear="all"><br>* Instead of defining NULL-POINTER-P, 
it would be better to simply reexport the symbol living in the "EXT" 
package. Patch attached.<br><br>* Upon reading the CFFI specification it
 seems that FOREIGN-FREE can only free memory that has been allocated by
 CFFI. However the test cases in misc-types.lsp do something else, 
deallocating the output of my_strdup() explicitely.<br><br>* At the low level ECL has two different foreign function interfaces: one used in the interpreter and relying on an external library (libffi) and another one, much simpler, using the C compiler. Right now CFFI was only using the former unless it was not available. I provide a patch that chooses the interface depending on the use of the code: interpreter or compiled. (patch attached).<br>




<br>* Is there the equivalent of launchpad for CFFI? Should I always 
submit the patches to the mailing list? I say this because there are other improvements I could forward when I find time.<br><br>Cheers<br><br>Juanjo<br clear="all"><font color="#888888"><br>-- <br>Instituto de Física Fundamental, CSIC<br>

c/ Serrano, 113b, Madrid 28006 (Spain) <br>
<a href="http://tream.dreamhosters.com" target="_blank">http://tream.dreamhosters.com</a><br>
</font></div><br><br clear="all"><br>-- <br>Instituto de Física Fundamental, CSIC<br>c/ Serrano, 113b, Madrid 28006 (Spain) <br><a href="http://tream.dreamhosters.com">http://tream.dreamhosters.com</a><br>