[Python-checkins] python/dist/src/Python sysmodule.c,2.107,2.108

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
Sun, 07 Jul 2002 12:59:52 -0700


Update of /cvsroot/python/python/dist/src/Python
In directory usw-pr-cvs1:/tmp/cvs-serv7577/python/Python

Modified Files:
	sysmodule.c 
Log Message:
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.


Index: sysmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/sysmodule.c,v
retrieving revision 2.107
retrieving revision 2.108
diff -C2 -d -r2.107 -r2.108
*** sysmodule.c	30 Jun 2002 15:26:10 -0000	2.107
--- sysmodule.c	7 Jul 2002 19:59:50 -0000	2.108
***************
*** 470,478 ****
  }
  
! #ifdef Py_TRACE_REFS
  static PyObject *
  sys_gettotalrefcount(PyObject *self)
  {
- 	extern long _Py_RefTotal;
  	return PyInt_FromLong(_Py_RefTotal);
  }
--- 470,477 ----
  }
  
! #ifdef Py_REF_DEBUG
  static PyObject *
  sys_gettotalrefcount(PyObject *self)
  {
  	return PyInt_FromLong(_Py_RefTotal);
  }
***************
*** 565,568 ****
--- 564,569 ----
  #ifdef Py_TRACE_REFS
  	{"getobjects",	_Py_GetObjects, METH_VARARGS},
+ #endif
+ #ifdef Py_REF_DEBUG
  	{"gettotalrefcount", (PyCFunction)sys_gettotalrefcount, METH_NOARGS},
  #endif