summaryrefslogtreecommitdiff
path: root/Objects
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2002-07-07 19:59:50 +0000
committerTim Peters <tim.peters@gmail.com>2002-07-07 19:59:50 +0000
commit9c23502323bff072003e6d6989069c8a70ada53d (patch)
treec35a534e7a9b27d1c0bbd898463cb064ea0c29ab /Objects
parent43f56dd4a3c4e80f0ce03feeb9aa5159b3cfa36f (diff)
downloadcpython-9c23502323bff072003e6d6989069c8a70ada53d.tar.gz
Rearranged and added comments to object.h, to clarify many things
that have taken me "too long" to reverse-engineer over the years. Vastly reduced the nesting level and redundancy of #ifdef-ery. Took a light stab at repairing comments that are no longer true. sys_gettotalrefcount(): Changed to enable under Py_REF_DEBUG. It was enabled under Py_TRACE_REFS, which was much heavier than necessary. sys.gettotalrefcount() is now available in a Py_REF_DEBUG-only build.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/object.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/Objects/object.c b/Objects/object.c
index 4cc9f6a917..5c5390849f 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -1858,9 +1858,7 @@ _Py_NewReference(PyObject *op)
op->_ob_prev = &refchain;
refchain._ob_next->_ob_prev = op;
refchain._ob_next = op;
-#ifdef COUNT_ALLOCS
- inc_count(op->ob_type);
-#endif
+ _PyMAYBE_BUMP_COUNT(op);
}
void
@@ -1885,9 +1883,7 @@ _Py_ForgetReference(register PyObject *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_frees++;
-#endif
+ _PyMAYBE_BUMP_FREECOUNT(op);
}
void