[gambit-list] gambit-ffi-types v0.2 released, now without wills.
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
This approach is beautifully simple and, unlike the one involving wills,
seems robust to me.
I also added some usage instructions to the README:
Happy new year!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Gambit-list