Commit 721a6b51 authored by Guido van Rossum's avatar Guido van Rossum

fix dusty debugging macros

parent d8a58929
...@@ -306,17 +306,17 @@ extern void inc_count Py_PROTO((PyTypeObject *)); ...@@ -306,17 +306,17 @@ extern void inc_count Py_PROTO((PyTypeObject *));
#endif #endif
#ifdef Py_REF_DEBUG #ifdef Py_REF_DEBUG
extern long ref_total; extern long _Py_RefTotal;
#ifndef Py_TRACE_REFS #ifndef Py_TRACE_REFS
#ifdef COUNT_ALLOCS #ifdef COUNT_ALLOCS
#define _Py_NewReference(op) (inc_count((op)->ob_type), ref_total++, (op)->ob_refcnt = 1) #define _Py_NewReference(op) (inc_count((op)->ob_type), _Py_RefTotal++, (op)->ob_refcnt = 1)
#else #else
#define _Py_NewReference(op) (ref_total++, (op)->ob_refcnt = 1) #define _Py_NewReference(op) (_Py_RefTotal++, (op)->ob_refcnt = 1)
#endif #endif
#endif #endif
#define Py_INCREF(op) (ref_total++, (op)->ob_refcnt++) #define Py_INCREF(op) (_Py_RefTotal++, (op)->ob_refcnt++)
#define Py_DECREF(op) \ #define Py_DECREF(op) \
if (--ref_total, --(op)->ob_refcnt != 0) \ if (--_Py_RefTotal, --(op)->ob_refcnt != 0) \
; \ ; \
else \ else \
_Py_Dealloc(op) _Py_Dealloc(op)
......
...@@ -26,7 +26,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ...@@ -26,7 +26,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "allobjects.h" #include "allobjects.h"
#ifdef REF_DEBUG #if defined( Py_TRACE_REFS ) || defined( Py_REF_DEBUG )
long ref_total; long ref_total;
#endif #endif
......
...@@ -508,7 +508,7 @@ resizestring(pv, newsize) ...@@ -508,7 +508,7 @@ resizestring(pv, newsize)
} }
/* XXX UNREF/NEWREF interface should be more symmetrical */ /* XXX UNREF/NEWREF interface should be more symmetrical */
#ifdef REF_DEBUG #ifdef REF_DEBUG
--ref_total; --_Py_RefTotal;
#endif #endif
UNREF(v); UNREF(v);
*pv = (object *) *pv = (object *)
......
...@@ -419,7 +419,7 @@ resizetuple(pv, newsize, last_is_sticky) ...@@ -419,7 +419,7 @@ resizetuple(pv, newsize, last_is_sticky)
return 0; return 0;
/* XXX UNREF/NEWREF interface should be more symmetrical */ /* XXX UNREF/NEWREF interface should be more symmetrical */
#ifdef REF_DEBUG #ifdef REF_DEBUG
--ref_total; --_Py_RefTotal;
#endif #endif
UNREF(v); UNREF(v);
if (last_is_sticky && sizediff < 0) { if (last_is_sticky && sizediff < 0) {
......
...@@ -288,7 +288,7 @@ eval_code(co, globals, locals, owner, arg) ...@@ -288,7 +288,7 @@ eval_code(co, globals, locals, owner, arg)
#ifdef LLTRACE #ifdef LLTRACE
int lltrace; int lltrace;
#endif #endif
#ifdef DEBUG #if defined( DEBUG ) || defined( LLTRACE )
/* Make it easier to find out where we are with dbx */ /* Make it easier to find out where we are with dbx */
char *filename = getstringvalue(co->co_filename); char *filename = getstringvalue(co->co_filename);
#endif #endif
......
...@@ -155,7 +155,7 @@ run_tty_loop(fp, filename) ...@@ -155,7 +155,7 @@ run_tty_loop(fp, filename)
for (;;) { for (;;) {
ret = run_tty_1(fp, filename); ret = run_tty_1(fp, filename);
#ifdef REF_DEBUG #ifdef REF_DEBUG
fprintf(stderr, "[%ld refs]\n", ref_total); fprintf(stderr, "[%ld refs]\n", _Py_RefTotal);
#endif #endif
if (ret == E_EOF) if (ret == E_EOF)
return 0; return 0;
...@@ -664,7 +664,7 @@ goaway(sts) ...@@ -664,7 +664,7 @@ goaway(sts)
err_clear(); err_clear();
#ifdef REF_DEBUG #ifdef REF_DEBUG
fprintf(stderr, "[%ld refs]\n", ref_total); fprintf(stderr, "[%ld refs]\n", _Py_RefTotal);
#endif #endif
#ifdef TRACE_REFS #ifdef TRACE_REFS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment