Commits

Guido van Rossum  committed f11ba9c

change in counting freed objects

  • Participants
  • Parent commits 68c7a0a
  • Branches legacy-trunk

Comments (0)

Files changed (1)

File Objects/object.c

 	typeobject *tp;
 {
 	if (tp->tp_alloc == 0) {
-		/* first time; hang in linked list */
+		/* first time; insert in linked list */
 		if (tp->tp_next != NULL) /* sanity check */
 			fatal("XXX inc_count sanity check");
 		tp->tp_next = type_list;
 	op->_ob_next->_ob_prev = op->_ob_prev;
 	op->_ob_prev->_ob_next = op->_ob_next;
 	op->_ob_next = op->_ob_prev = NULL;
+#ifdef COUNT_ALLOCS
+	op->ob_type->tp_free++;
+#endif
 }
 
 DELREF(op)
 {
 	destructor dealloc = op->ob_type->tp_dealloc;
 	UNREF(op);
-#ifdef COUNT_ALLOCS
-	op->ob_type->tp_free++;
-#endif
 	op->ob_type = NULL;
 	(*dealloc)(op);
 }