[gambit-list] gambit-ffi-types v0.2 released, now without wills.

Estevo euccastro at gmail.com
Tue Dec 31 22:11:22 EST 2013


I've finally found a way to manage references between foreign objects
(which actually works for any kind of Scheme memory-allocated object) that
avoids the problems of using wills.  I keep a mapping from _serial numbers_
of dependent objects to references to the objects they depend upon.  On
garbage collection (using the ##add-gc-interrupt-job! hook), I walk this
mapping (currently an assoc list) and remove any entries where the serial
number can no longer be found in ##serial-number-to-object-table.  So you
call it a table with anemic (weaker than weak!) keys.  See

https://github.com/euccastro/gambit-ffi-types/blob/master/ffi-types-lib.scm

This approach is beautifully simple and, unlike the one involving wills,
seems robust to me.

I also added some usage instructions to the README:

https://github.com/euccastro/gambit-ffi-types

Happy new year!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20140101/25e91043/attachment.htm>


More information about the Gambit-list mailing list