[cffi-devel] A question about memory management and garbage collection

nitralime nitralime at googlemail.com
Tue May 10 09:04:04 UTC 2011


On 05/09/2011 06:44 PM, Martin Simmons wrote:
> Your examples will be safe, but
>
> (get-row (getf (call-a-foreign-function ...) :tab) 0)
>
> might crash.

I got it now!! I thought that an object in a nested call like

        (get-row (getf (call-a-foreign-function ...) :tab) 0)

must be considered as live/reachable until the outer most
call is complete. Otherwise, you will have the same problem
even with pure Lisp object as well. I'm not very familiar
with the delicate technical aspects of runtime systems of
Lisp implementations and maybe I make a fundamental mistake
at that point!!

Regards
Nik

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cffi-devel/attachments/20110510/aa8c2ac5/attachment.html>


More information about the cffi-devel mailing list