[cffi-devel] [PATCH] 64-bit support for Allegro, and allocate stack objects in the static area

Luís Oliveira luismbo at gmail.com
Fri Jan 9 01:44:16 UTC 2009


On Fri, Jan 9, 2009 at 12:51 AM, John Fremlin <jf at msi.co.jp> wrote:
>> The page <http://www.franz.com/support/documentation/8.1/doc/foreign-functions.htm>
>> documents the :FOREIGN-ADDRESS type.
>
> I kept trying to point out that this was being used by cffi as a *Lisp*
> type not a *foreign-type*. It is not a Lisp type.

Oh, yes, that part was clearly broken. But it was being used a foreign
type as well, but even then it doesn't seem to work in all contexts.


> The other change from my patch was about allocating the stack objects in
> a space that will not be moved by the GC.

I've applied that already, thanks! IIUC, :FOREIGN-STATIC-GC is only
relevant when WITH-STACK-FOBJECT fails to stack allocate, in which
case it actually allocates on the heap.

Hmm, now that I read the documentation more carefully, it seems that
if WITH-STACK-FOBJECT allocates on the heap then it won't deallocate
the object and we should be using WITH-STATIC-FOBJECT instead. Does
that sound right? If it does, I'll apply the attached patch during the
weekend or so.


> Is it a necessary according to the CFFI semantics of with-foreign-object?

Indeed.

-- 
Luís Oliveira
http://student.dei.uc.pt/~lmoliv/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: allegro-wfp.diff
Type: text/x-diff
Size: 1928 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/cffi-devel/attachments/20090109/a147384d/attachment.diff>


More information about the cffi-devel mailing list