[Python-checkins] r70550 - in python/trunk/Objects: dictobject.c tupleobject.c

antoine.pitrou python-checkins at python.org
Mon Mar 23 20:17:01 CET 2009


Author: antoine.pitrou
Date: Mon Mar 23 20:17:00 2009
New Revision: 70550

Log:
The tracking statistics were actually too pessimistic



Modified:
   python/trunk/Objects/dictobject.c
   python/trunk/Objects/tupleobject.c

Modified: python/trunk/Objects/dictobject.c
==============================================================================
--- python/trunk/Objects/dictobject.c	(original)
+++ python/trunk/Objects/dictobject.c	Mon Mar 23 20:17:00 2009
@@ -498,6 +498,7 @@
 			_PyObject_GC_MAY_BE_TRACKED(ep[i].me_key))
 			return;
 	}
+	DECREASE_TRACK_COUNT
 	_PyObject_GC_UNTRACK(op);
 }
 

Modified: python/trunk/Objects/tupleobject.c
==============================================================================
--- python/trunk/Objects/tupleobject.c	(original)
+++ python/trunk/Objects/tupleobject.c	Mon Mar 23 20:17:00 2009
@@ -50,9 +50,6 @@
 {
 	register PyTupleObject *op;
 	Py_ssize_t i;
-#ifdef SHOW_TRACK_COUNT
-	count_tracked++;
-#endif
 	if (size < 0) {
 		PyErr_BadInternalCall();
 		return NULL;
@@ -104,6 +101,9 @@
 		Py_INCREF(op);	/* extra INCREF so that this is never freed */
 	}
 #endif
+#ifdef SHOW_TRACK_COUNT
+	count_tracked++;
+#endif
 	_PyObject_GC_TRACK(op);
 	return (PyObject *) op;
 }


More information about the Python-checkins mailing list