summaryrefslogtreecommitdiff
path: root/Python/sysmodule.c
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
commit4be93d0e848ca2dc55f119a7b0eb31fb995d7d33 (patch)
tree8182b9569a84e2a82a942c5eb97963cbf7e2c98b /Python/sysmodule.c
parent144dea3e05d82388c73011d66733726048765ebd (diff)
downloadcpython-git-4be93d0e848ca2dc55f119a7b0eb31fb995d7d33.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 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 549bbec96d..4a0bf37622 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -469,11 +469,10 @@ sys_getrefcount(PyObject *self, PyObject *arg)
return PyInt_FromLong(arg->ob_refcnt);
}
-#ifdef Py_TRACE_REFS
+#ifdef Py_REF_DEBUG
static PyObject *
sys_gettotalrefcount(PyObject *self)
{
- extern long _Py_RefTotal;
return PyInt_FromLong(_Py_RefTotal);
}
@@ -564,6 +563,8 @@ static PyMethodDef sys_methods[] = {
#endif
#ifdef Py_TRACE_REFS
{"getobjects", _Py_GetObjects, METH_VARARGS},
+#endif
+#ifdef Py_REF_DEBUG
{"gettotalrefcount", (PyCFunction)sys_gettotalrefcount, METH_NOARGS},
#endif
{"getrefcount", (PyCFunction)sys_getrefcount, METH_O, getrefcount_doc},