This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author nascheme
Recipients
Date 2001-05-06.21:42:31
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
This patch adds three new APIs:

	PyObject_GC_New
	PyObject_GC_NewVar
	PyObject_GC_Resize
	PyObject_GC_Del

and renames PyObject_GC_Init and PyObject_GC_Fini to:

	PyObject_GC_Track
	PyObject_GC_Ignore

respectively.  Objects that wish to be tracked by the
collector must use these new APIs.  Many more details
about the GC implementation are hidden inside
gcmodule.c.  There seems to be no change in
performance.

Note that PyObject_GC_{New,NewVar} automatically adds
the object to the GC lists.  There is no need to
call PyObject_GC_Track.  PyObject_GC_Del automatically
removes the object from the GC list but usually you
want to call PyObject_GC_Ignore yourself (DECREFs can
end up running arbitrary code).

It should be more difficult to corrupt the GC linked
lists now.  Also, you can now call PyObject_GC_Ignore
on objects that you know will not create RCs. The
_weakref module does this.  Previously, every object
that had the GC type flag set and could be found by
using tp_traverse had to be in a GC linked list.
History
Date User Action Args
2007-08-23 15:05:06adminlinkissue421893 messages
2007-08-23 15:05:06admincreate