[Ecls-list] Arrays to C and C to Arrays....

Juan Jose Garcia-Ripoll juanjose.garciaripoll at googlemail.com
Sun Nov 8 12:21:49 UTC 2009


On Sun, Nov 8, 2009 at 12:56 PM, Juan Jose Garcia-Ripoll
<juanjose.garciaripoll at googlemail.com> wrote:
> On Sun, Nov 8, 2009 at 4:52 AM, Brad Beer <bradwbeer at gmail.com> wrote:
>> How can I convert C arrays to Lisp Arrays and vice-versa using only the FFI?
>
> You mean without copying data? That is not supported because your FFI
> data might not be even created by the garbage collector at all. The
> converse, extracting the pointer from a lisp array, is plain easy: use
> c-inline. But again: you have to keep a valid reference to the lisp
> array object (not data) somewhere.

Sorry, I forgot that there is a function doing this already:

(ext::make-foreign-data-from-array array) => foreign object

-- 
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com




More information about the ecl-devel mailing list