[Python-checkins] CVS: python/dist/src/Objects methodobject.c,2.40,2.41

Neil Schemenauer nascheme@users.sourceforge.net
Mon, 18 Mar 2002 12:44:56 -0800


Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv24651/Objects

Modified Files:
	methodobject.c 
Log Message:
Re-enable GC of method objects.


Index: methodobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/methodobject.c,v
retrieving revision 2.40
retrieving revision 2.41
diff -C2 -d -r2.40 -r2.41
*** methodobject.c	20 Sep 2001 21:45:26 -0000	2.40
--- methodobject.c	18 Mar 2002 20:44:53 -0000	2.41
***************
*** 16,20 ****
  	}
  	else {
! 		op = PyObject_NEW(PyCFunctionObject, &PyCFunction_Type);
  		if (op == NULL)
  			return NULL;
--- 16,20 ----
  	}
  	else {
! 		op = PyObject_GC_New(PyCFunctionObject, &PyCFunction_Type);
  		if (op == NULL)
  			return NULL;
***************
*** 23,27 ****
  	Py_XINCREF(self);
  	op->m_self = self;
! 	PyObject_GC_Init(op);
  	return (PyObject *)op;
  }
--- 23,27 ----
  	Py_XINCREF(self);
  	op->m_self = self;
! 	_PyObject_GC_TRACK(op);
  	return (PyObject *)op;
  }
***************
*** 112,116 ****
  meth_dealloc(PyCFunctionObject *m)
  {
! 	PyObject_GC_Fini(m);
  	Py_XDECREF(m->m_self);
  	m->m_self = (PyObject *)free_list;
--- 112,116 ----
  meth_dealloc(PyCFunctionObject *m)
  {
! 	_PyObject_GC_UNTRACK(m);
  	Py_XDECREF(m->m_self);
  	m->m_self = (PyObject *)free_list;
***************
*** 217,221 ****
  	0,
  	"builtin_function_or_method",
! 	sizeof(PyCFunctionObject) + PyGC_HEAD_SIZE,
  	0,
  	(destructor)meth_dealloc, 		/* tp_dealloc */
--- 217,221 ----
  	0,
  	"builtin_function_or_method",
! 	sizeof(PyCFunctionObject),
  	0,
  	(destructor)meth_dealloc, 		/* tp_dealloc */
***************
*** 234,238 ****
  	0,					/* tp_setattro */
  	0,					/* tp_as_buffer */
! 	Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC,	/* tp_flags */
   	0,					/* tp_doc */
   	(traverseproc)meth_traverse,		/* tp_traverse */
--- 234,238 ----
  	0,					/* tp_setattro */
  	0,					/* tp_as_buffer */
! 	Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */
   	0,					/* tp_doc */
   	(traverseproc)meth_traverse,		/* tp_traverse */
***************
*** 328,333 ****
  		PyCFunctionObject *v = free_list;
  		free_list = (PyCFunctionObject *)(v->m_self);
! 		v = (PyCFunctionObject *) PyObject_AS_GC(v);
! 		PyObject_DEL(v);
  	}
  }
--- 328,332 ----
  		PyCFunctionObject *v = free_list;
  		free_list = (PyCFunctionObject *)(v->m_self);
! 		PyObject_GC_Del(v);
  	}
  }