summaryrefslogtreecommitdiffstats
path: root/Objects/classobject.c
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2000-06-23 19:37:02 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2000-06-23 19:37:02 (GMT)
commitd08b4c4524a31695d7e63768c02f472c9cb54fbd (patch)
treeb81cade431fa30d6446fef0122a3796b0876c8a2 /Objects/classobject.c
parentd22162bac7e42ccf90571ee2607c9c42ed2df3fe (diff)
downloadcpython-d08b4c4524a31695d7e63768c02f472c9cb54fbd.zip
cpython-d08b4c4524a31695d7e63768c02f472c9cb54fbd.tar.gz
cpython-d08b4c4524a31695d7e63768c02f472c9cb54fbd.tar.bz2
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.
Diffstat (limited to 'Objects/classobject.c')
-rw-r--r--Objects/classobject.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Objects/classobject.c b/Objects/classobject.c
index 114f2d9..04362a7 100644
--- a/Objects/classobject.c
+++ b/Objects/classobject.c
@@ -428,7 +428,7 @@ PyTypeObject PyClass_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"class",
- sizeof(PyClassObject),
+ sizeof(PyClassObject) + PyGC_INFO_SIZE,
0,
(destructor)class_dealloc, /*tp_dealloc*/
0, /*tp_print*/
@@ -445,7 +445,7 @@ PyTypeObject PyClass_Type = {
(getattrofunc)class_getattr, /*tp_getattro*/
(setattrofunc)class_setattr, /*tp_setattro*/
0, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT, /*tp_flags*/
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC, /*tp_flags*/
0, /* tp_doc */
(traverseproc)class_traverse, /* tp_traverse */
};
@@ -1513,7 +1513,7 @@ PyTypeObject PyInstance_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"instance",
- sizeof(PyInstanceObject),
+ sizeof(PyInstanceObject) + PyGC_INFO_SIZE,
0,
(destructor)instance_dealloc, /*tp_dealloc*/
0, /*tp_print*/
@@ -1530,7 +1530,7 @@ PyTypeObject PyInstance_Type = {
(getattrofunc)instance_getattr, /*tp_getattro*/
(setattrofunc)instance_setattr, /*tp_setattro*/
0, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT, /*tp_flags*/
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC, /*tp_flags*/
0, /* tp_doc */
(traverseproc)instance_traverse, /* tp_traverse */
};
@@ -1748,7 +1748,7 @@ PyTypeObject PyMethod_Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
"instance method",
- sizeof(PyMethodObject),
+ sizeof(PyMethodObject) + PyGC_INFO_SIZE,
0,
(destructor)instancemethod_dealloc, /*tp_dealloc*/
0, /*tp_print*/
@@ -1765,7 +1765,7 @@ PyTypeObject PyMethod_Type = {
(getattrofunc)instancemethod_getattr, /*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)instancemethod_traverse, /* tp_traverse */
};