[Patches] Re: Trashcan vs. GC vs. TRACE_REFS
Neil Schemenauer
nascheme@enme.ucalgary.ca
Tue, 25 Apr 2000 20:11:31 -0600
On Wed, Apr 26, 2000 at 11:56:59AM +1000, Mark Hammond wrote:
> If you are saying that there are no (known) extension types
> that could possibly be affected, and that any written in the
> future must match Python's GC mode - then it sounds perfect,
> and a bridge to cross when we come to it (by which time of
> course the patch will prove so wonderful that it is made
> standard :-)
That's what I'm saying. Types that want to "be involved in GC"
must:
Use PyGC_NEW* instead of PyObject_NEW*.
Use PyGC_Del to free the object structure.
Call PyGC_Insert and PyGC_Remove appropriately. Objects
should only be included in the GC set when they are valid.
Implement tp_recurse.
Add the feature bit Py_TPFLAGS_HAVE_GCINFO.
Types which don't "op-in" for GC are safe.
> That's-one-long-sentence-ly,
Especially when its on one line. :)
Neil