Reference counting garbage collection

Andrew Dalke dalke at dalkescientific.com
Thu Aug 23 08:23:18 EDT 2001


Paul Rubin wrote:
>Why is determinism such an issue?

Because I'm working with a C library that maintains its own
set of interdependencies that need to be deallocated in the
correct order.

In addition, the library is used by C and Fortran code, so
the API exposes pointers as integer handles rather than raw
pointer values.  This means there's a table somewhere with
a list of all objects created by the library.

No gc scheme I know of is smart enough to automatically figure
out which integer gets mapped to a pointer, what the
dependencies are between the integer handles, and which API
function to call to deallocate things.

So the determinisism of ref counting lets me put my dependency
scheme on top of things to ensure that everything is done in
the order expected by the library.

                    Andrew
                    dalke at dalkescientific.com






More information about the Python-list mailing list