]> granicus.if.org Git - python/commit
Trashcan cleanup: Now that cyclic gc is always there, the trashcan
authorTim Peters <tim.peters@gmail.com>
Sun, 7 Jul 2002 05:13:56 +0000 (05:13 +0000)
committerTim Peters <tim.peters@gmail.com>
Sun, 7 Jul 2002 05:13:56 +0000 (05:13 +0000)
commit803526b9e222077c5f9391d7e7348156eb7ba7da
treebd0cc321d21df84bc9e7b11457ef844d4ddf2e21
parent943382c8e5009da895679798e1e740a0661fbf7e
Trashcan cleanup:  Now that cyclic gc is always there, the trashcan
mechanism is no longer evil:  it no longer plays dangerous games with
the type pointer or refcounts, and objects in extension modules can play
along too without needing to edit the core first.

Rewrote all the comments to explain this, and (I hope) give clear
guidance to extension authors who do want to play along.  Documented
all the functions.  Added more asserts (it may no longer be evil, but
it's still dangerous <0.9 wink>).  Rearranged the generated code to
make it clearer, and to tolerate either the presence or absence of a
semicolon after the macros.  Rewrote _PyTrash_destroy_chain() to call
tp_dealloc directly; it was doing a Py_DECREF again, and that has all
sorts of obscure distorting effects in non-release builds (Py_DECREF
was already called on the object!).  Removed Christian's little "embedded
change log" comments -- that's what checkin messages are for, and since
it was impossible to correlate the comments with the code that changed,
I found them merely distracting.
Include/object.h
Modules/gcmodule.c
Objects/object.c