diff Python/sysmodule.c @ 24126:fdf80e04e4bb legacy-trunk

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.
author Tim Peters <tim.peters@gmail.com>
date Sun, 07 Jul 2002 19:59:50 +0000
parents 8142f8d668a0
children a69a12484d69
line wrap: on
line diff
--- a/Python/sysmodule.c	Sun Jul 07 16:57:35 2002 +0000
+++ b/Python/sysmodule.c	Sun Jul 07 19:59:50 2002 +0000
@@ -469,11 +469,10 @@
 	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 @@
 #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},