[Python-checkins] CVS: python/dist/src/Objects iterobject.c,1.7,1.8

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


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

Modified Files:
	iterobject.c 
Log Message:
Re-enable GC of iter objects.


Index: iterobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/iterobject.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** iterobject.c	16 Aug 2001 13:15:00 -0000	1.7
--- iterobject.c	18 Mar 2002 20:43:51 -0000	1.8
***************
*** 13,17 ****
  {
  	seqiterobject *it;
! 	it = PyObject_NEW(seqiterobject, &PySeqIter_Type);
  	if (it == NULL)
  		return NULL;
--- 13,17 ----
  {
  	seqiterobject *it;
! 	it = PyObject_GC_New(seqiterobject, &PySeqIter_Type);
  	if (it == NULL)
  		return NULL;
***************
*** 19,23 ****
  	Py_INCREF(seq);
  	it->it_seq = seq;
! 	PyObject_GC_Init(it);
  	return (PyObject *)it;
  }
--- 19,23 ----
  	Py_INCREF(seq);
  	it->it_seq = seq;
! 	_PyObject_GC_TRACK(it);
  	return (PyObject *)it;
  }
***************
*** 25,32 ****
  iter_dealloc(seqiterobject *it)
  {
! 	PyObject_GC_Fini(it);
  	Py_DECREF(it->it_seq);
! 	it = (seqiterobject *) PyObject_AS_GC(it);
! 	PyObject_DEL(it);
  }
  
--- 25,31 ----
  iter_dealloc(seqiterobject *it)
  {
! 	_PyObject_GC_UNTRACK(it);
  	Py_DECREF(it->it_seq);
! 	PyObject_GC_Del(it);
  }
  
***************
*** 101,105 ****
  	0,					/* ob_size */
  	"iterator",				/* tp_name */
! 	sizeof(seqiterobject) + PyGC_HEAD_SIZE,	/* tp_basicsize */
  	0,					/* tp_itemsize */
  	/* methods */
--- 100,104 ----
  	0,					/* ob_size */
  	"iterator",				/* tp_name */
! 	sizeof(seqiterobject),			/* tp_basicsize */
  	0,					/* tp_itemsize */
  	/* methods */
***************
*** 119,123 ****
  	0,					/* tp_setattro */
  	0,					/* tp_as_buffer */
! 	Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC,	/* tp_flags */
   	0,					/* tp_doc */
   	(traverseproc)iter_traverse,		/* tp_traverse */
--- 118,122 ----
  	0,					/* tp_setattro */
  	0,					/* tp_as_buffer */
! 	Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */
   	0,					/* tp_doc */
   	(traverseproc)iter_traverse,		/* tp_traverse */
***************
*** 148,152 ****
  {
  	calliterobject *it;
! 	it = PyObject_NEW(calliterobject, &PyCallIter_Type);
  	if (it == NULL)
  		return NULL;
--- 147,151 ----
  {
  	calliterobject *it;
! 	it = PyObject_GC_New(calliterobject, &PyCallIter_Type);
  	if (it == NULL)
  		return NULL;
***************
*** 155,159 ****
  	Py_INCREF(sentinel);
  	it->it_sentinel = sentinel;
! 	PyObject_GC_Init(it);
  	return (PyObject *)it;
  }
--- 154,158 ----
  	Py_INCREF(sentinel);
  	it->it_sentinel = sentinel;
! 	_PyObject_GC_TRACK(it);
  	return (PyObject *)it;
  }
***************
*** 161,169 ****
  calliter_dealloc(calliterobject *it)
  {
! 	PyObject_GC_Fini(it);
  	Py_DECREF(it->it_callable);
  	Py_DECREF(it->it_sentinel);
! 	it = (calliterobject *) PyObject_AS_GC(it);
! 	PyObject_DEL(it);
  }
  
--- 160,167 ----
  calliter_dealloc(calliterobject *it)
  {
! 	_PyObject_GC_UNTRACK(it);
  	Py_DECREF(it->it_callable);
  	Py_DECREF(it->it_sentinel);
! 	PyObject_GC_Del(it);
  }
  
***************
*** 219,223 ****
  	0,					/* ob_size */
  	"callable-iterator",			/* tp_name */
! 	sizeof(calliterobject) + PyGC_HEAD_SIZE,/* tp_basicsize */
  	0,					/* tp_itemsize */
  	/* methods */
--- 217,221 ----
  	0,					/* ob_size */
  	"callable-iterator",			/* tp_name */
! 	sizeof(calliterobject),			/* tp_basicsize */
  	0,					/* tp_itemsize */
  	/* methods */
***************
*** 237,241 ****
  	0,					/* tp_setattro */
  	0,					/* tp_as_buffer */
! 	Py_TPFLAGS_DEFAULT | Py_TPFLAGS_GC,	/* tp_flags */
   	0,					/* tp_doc */
   	(traverseproc)calliter_traverse,	/* tp_traverse */
--- 235,239 ----
  	0,					/* tp_setattro */
  	0,					/* tp_as_buffer */
! 	Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */
   	0,					/* tp_doc */
   	(traverseproc)calliter_traverse,	/* tp_traverse */