Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d8953cb

Browse files
committed
change in counting freed objects
1 parent 91e7a0b commit d8953cb

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Objects/object.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ inc_count(tp)
6161
typeobject *tp;
6262
{
6363
if (tp->tp_alloc == 0) {
64-
/* first time; hang in linked list */
64+
/* first time; insert in linked list */
6565
if (tp->tp_next != NULL) /* sanity check */
6666
fatal("XXX inc_count sanity check");
6767
tp->tp_next = type_list;
@@ -490,16 +490,16 @@ UNREF(op)
490490
op->_ob_next->_ob_prev = op->_ob_prev;
491491
op->_ob_prev->_ob_next = op->_ob_next;
492492
op->_ob_next = op->_ob_prev = NULL;
493+
#ifdef COUNT_ALLOCS
494+
op->ob_type->tp_free++;
495+
#endif
493496
}
494497

495498
DELREF(op)
496499
object *op;
497500
{
498501
destructor dealloc = op->ob_type->tp_dealloc;
499502
UNREF(op);
500-
#ifdef COUNT_ALLOCS
501-
op->ob_type->tp_free++;
502-
#endif
503503
op->ob_type = NULL;
504504
(*dealloc)(op);
505505
}

0 commit comments

Comments
 (0)