diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2000-06-30 05:02:53 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2000-06-30 05:02:53 (GMT) |
commit | c5007aa5c3d64109578cf12b026ca6305acff97b (patch) | |
tree | a576fb8432ea60a6b6db49c09937551903938003 /Objects/funcobject.c | |
parent | 4e542a3d9995addd08e7675a63cb0c8ee61a5010 (diff) | |
download | cpython-c5007aa5c3d64109578cf12b026ca6305acff97b.zip cpython-c5007aa5c3d64109578cf12b026ca6305acff97b.tar.gz cpython-c5007aa5c3d64109578cf12b026ca6305acff97b.tar.bz2 |
final patches from Neil Schemenauer for garbage collection
Diffstat (limited to 'Objects/funcobject.c')
-rw-r--r-- | Objects/funcobject.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/funcobject.c b/Objects/funcobject.c index d9ce027..2736d65 100644 --- a/Objects/funcobject.c +++ b/Objects/funcobject.c @@ -63,6 +63,7 @@ PyFunction_New(code, globals) Py_INCREF(doc); op->func_doc = doc; } + PyObject_GC_Init(op); return (PyObject *)op; } @@ -186,6 +187,7 @@ static void func_dealloc(op) PyFunctionObject *op; { + PyObject_GC_Fini(op); Py_DECREF(op->func_code); Py_DECREF(op->func_globals); Py_DECREF(op->func_name); @@ -277,7 +279,7 @@ PyTypeObject PyFunction_Type = { PyObject_HEAD_INIT(&PyType_Type) 0, "function", - sizeof(PyFunctionObject) + PyGC_INFO_SIZE, + sizeof(PyFunctionObject) + PyGC_HEAD_SIZE, 0, (destructor)func_dealloc, /*tp_dealloc*/ 0, /*tp_print*/ |