]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
change in counting freed objects
authorGuido van Rossum <guido@python.org>
Thu, 6 Apr 1995 14:46:26 +0000 (14:46 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 6 Apr 1995 14:46:26 +0000 (14:46 +0000)
Objects/object.c

index fc8d525d7ddcac42acf26424dc08b08779fa0dbc..d7110ae852af5c4bbc1479237a895a63cc3c51d3 100644 (file)
@@ -61,7 +61,7 @@ inc_count(tp)
        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;
@@ -490,6 +490,9 @@ UNREF(op)
        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)
@@ -497,9 +500,6 @@ 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);
 }