[Patches] New sys method to return total reference count in debug builds.

Trent Mick trentm@activestate.com
Wed, 7 Jun 2000 09:11:53 -0700



On Mon, Jun 05, 2000 at 09:18:30AM +1000, Mark Hammond wrote:
> + #ifdef Py_TRACE_REFS
> + static PyObject *
> + sys_gettotalrefcount(PyObject *self, PyObject *args)
> + {
> + 	extern long _Py_RefTotal;
> + 	if (!PyArg_ParseTuple(args, ":gettotalrefcount"))
> + 		return NULL;
> + 	return PyInt_FromLong((long) _Py_RefTotal);
> + }

I would just drop the (long) cast. It is not necessary and just adds a
potential truncation if _Py_RefTotal is ever changed to size_t or something
like that.

Otherwise, +0.

Trent

-- 
Trent Mick
trentm@activestate.com