[cffi-devel] Re: foreign-alloc

Martin Simmons martin at lispworks.com
Wed Sep 7 10:51:54 UTC 2005


>>>>> On Wed, 07 Sep 2005 06:54:49 +0100, Luis Oliveira <luismbo at gmail.com> said:

  Luis> Martin Simmons <martin at lispworks.com> writes:

  Luis> CFFI> (foreign-alloc :string :initial-element "foo")
  Luis> ;; I think this should do something similar to CLISP's
  Luis> ;; FFI:ALLOCATE-DEEP, and it should Just Work if we apply the :to-c
  Luis> ;; translator, which will allocate space for "foo".
  >> 
  >> I think it depends on whether the :STRING type is an array type, a pointer
  >> type or some magic.

  Luis> CFFI's :string is a pointer and the translator will allocate memory for
  Luis> "foo", so will actually get a char** in this case, not a char*. Hmm..

Aha! :-)


  Luis> By the way, I remember now I found some bugs in Lispworks's FLI (I'm
  Luis> using Lispworks 4.4.5 Personal Edition), will report them tomorrow with
  Luis> some test cases.

Thanks.  BTW, if you had problems with the LW header-file parser and ALCvoid
(from OpenAL) not working as void in nullary function decl then I've fix that
one just now.

-- 
Martin Simmons
LispWorks Ltd



More information about the cffi-devel mailing list