]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
move_finalizers(): Rewrote. It's not necessary for this routine
authorTim Peters <tim.peters@gmail.com>
Sat, 5 Apr 2003 18:40:50 +0000 (18:40 +0000)
committerTim Peters <tim.peters@gmail.com>
Sat, 5 Apr 2003 18:40:50 +0000 (18:40 +0000)
commitf6ae7a43eb781f2922309278d8005415e507ad28
treeaab06f53e6b8a16e95af4a4f58fadbcbe7120e14
parent2f74fddfc1bd81838cb80e726d391f4c810e525a
move_finalizers():  Rewrote.  It's not necessary for this routine
to special-case classic classes, or to worry about refcounts;
has_finalizer() deleted the current object iff the first entry in
the unreachable list has changed.  I don't believe it was correct
to check for ob_refcnt == 1, either:  the dealloc routine would get
called by Py_DECREF then, but there's nothing to stop the dealloc
routine from ressurecting the object, and then gc would remain at
the head of the unreachable list despite that its refcount temporarily
fell to 0 (and that would lead to an infinite loop in move_finalizers()).

I'm still worried about has_finalizer() resurrecting other objects
in the unreachable list:  what's to stop them from getting collected?
Modules/gcmodule.c