part 2 of Neil Schemenauer's GC patches:

This patch modifies the type structures of objects that
participate in GC.  The object's tp_basicsize is increased when
GC is enabled.  GC information is prefixed to the object to
maintain binary compatibility.  GC objects also define the
tp_flag Py_TPFLAGS_GC.
This commit is contained in:
Jeremy Hylton 2000-06-23 19:37:02 +00:00
parent d22162bac7
commit d08b4c4524
7 changed files with 36 additions and 20 deletions

View file

@ -275,7 +275,7 @@ PyTypeObject PyFunction_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"function",
sizeof(PyFunctionObject),
sizeof(PyFunctionObject) + PyGC_INFO_SIZE,
0,
(destructor)func_dealloc, /*tp_dealloc*/
0, /*tp_print*/
@ -292,7 +292,7 @@ PyTypeObject PyFunction_Type = {
0, /*tp_getattro*/
0, /*tp_setattro*/
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT, /*tp_flags*/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC, /*tp_flags*/
0, /* tp_doc */
(traverseproc)func_traverse, /* tp_traverse */
};