Author kristjan.jonsson
Recipients kristjan.jonsson, pitrou, stutzbach, tim.peters
Date 2010-07-09.22:41:08
SpamBayes Score 0.00273485
Marked as misclassified No
Message-id <>
Hi Antoine.
I am not adding another traversal pass.  I am modifying the function that gets called for every object about to be collected, to call the object's traversal function.  This is hardly an extra "pass" and is done only for objects that are about to be collected (i.e. only in the rare case).

The particular case is this:  I have objects (tasklets) that depending on their runtime state, need to run a finalizer or not.  If not, they can be collected.  If they do, then they end up on gc.garbage.

This is exactly the same case as with generators.  But instead of adding yet another special case into stackless python, I realized that it may be up to objects' runtime state whether they need to run a finalizer or not.  So, I wrote a more generic way and decided to contribute it to C Python, so that a future developer, having a C extension that only sometimes needs to run a finalizer, could have a way to cleanly deal with garbage collection.  This is twice now that this problem has been seen in python.  The first time, a special case was coded into gcmodule.  This second time, I'm offering a more generic solution.

Now, I have a number of useful improvements and additions to C python sitting in our repository, the result of over 7 years work with Python at CCP games.  I have another one sitting and waiting that adds useful functionality to gcmodule.  Useful in my opinion anyway, and worth at least being kept for posterity as a patch in the tracker.  But since these patches of mine seem to be met with rather limited enthusiasm,  I wonder if I should be bothering.
Date User Action Args
2010-07-09 22:41:12kristjan.jonssonsetrecipients: + kristjan.jonsson, tim.peters, pitrou, stutzbach
2010-07-09 22:41:11kristjan.jonssonsetmessageid: <>
2010-07-09 22:41:09kristjan.jonssonlinkissue9141 messages
2010-07-09 22:41:08kristjan.jonssoncreate