]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
fix dusty debugging macros
authorGuido van Rossum <guido@python.org>
Wed, 29 Mar 1995 16:57:48 +0000 (16:57 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 29 Mar 1995 16:57:48 +0000 (16:57 +0000)
Include/object.h
Objects/object.c
Objects/stringobject.c
Objects/tupleobject.c
Python/ceval.c
Python/pythonrun.c

index 0b679d544d0c1d9402a5edf9df11b4ce9f2c0805..0b85fd3f4b81afb928ea8bc575ce0583b28feabd 100644 (file)
@@ -306,17 +306,17 @@ extern void inc_count Py_PROTO((PyTypeObject *));
 #endif
 
 #ifdef Py_REF_DEBUG
-extern long ref_total;
+extern long _Py_RefTotal;
 #ifndef Py_TRACE_REFS
 #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
-#define _Py_NewReference(op) (ref_total++, (op)->ob_refcnt = 1)
+#define _Py_NewReference(op) (_Py_RefTotal++, (op)->ob_refcnt = 1)
 #endif
 #endif
-#define Py_INCREF(op) (ref_total++, (op)->ob_refcnt++)
+#define Py_INCREF(op) (_Py_RefTotal++, (op)->ob_refcnt++)
 #define Py_DECREF(op) \
-       if (--ref_total, --(op)->ob_refcnt != 0) \
+       if (--_Py_RefTotal, --(op)->ob_refcnt != 0) \
                ; \
        else \
                _Py_Dealloc(op)
index d93d28b3e8dd699a3f5751744886ef8a6e7ceea2..fc8d525d7ddcac42acf26424dc08b08779fa0dbc 100644 (file)
@@ -26,7 +26,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
 #include "allobjects.h"
 
-#ifdef REF_DEBUG
+#if defined( Py_TRACE_REFS ) || defined( Py_REF_DEBUG )
 long ref_total;
 #endif
 
index b09fc2546df93e793d214de625e86c89b02a78b1..54f161f3faa3486d1fa0044642f51b2de6d43ffc 100644 (file)
@@ -508,7 +508,7 @@ resizestring(pv, newsize)
        }
        /* XXX UNREF/NEWREF interface should be more symmetrical */
 #ifdef REF_DEBUG
-       --ref_total;
+       --_Py_RefTotal;
 #endif
        UNREF(v);
        *pv = (object *)
index 69c4f95937629e7b9c8879c6948d64a395c9e7b3..7fae2647b0dcac44e0e0c0591d6067d5bfe0fd04 100644 (file)
@@ -419,7 +419,7 @@ resizetuple(pv, newsize, last_is_sticky)
                return 0;
        /* XXX UNREF/NEWREF interface should be more symmetrical */
 #ifdef REF_DEBUG
-       --ref_total;
+       --_Py_RefTotal;
 #endif
        UNREF(v);
        if (last_is_sticky && sizediff < 0) {
index 041ae4dfc3d8abc9fbd33d4383bc0bf2d40a6267..3fa03c0afd4f109f3b3fa8c66438970c9d28726d 100644 (file)
@@ -288,7 +288,7 @@ eval_code(co, globals, locals, owner, arg)
 #ifdef LLTRACE
        int lltrace;
 #endif
-#ifdef DEBUG
+#if defined( DEBUG ) || defined( LLTRACE )
        /* Make it easier to find out where we are with dbx */
        char *filename = getstringvalue(co->co_filename);
 #endif
index 96f385f9e28a70c27d62f2265f509d84668ee1bf..734b72b0c4480782dc3c9db41ef10ce932fac86f 100644 (file)
@@ -155,7 +155,7 @@ run_tty_loop(fp, filename)
        for (;;) {
                ret = run_tty_1(fp, filename);
 #ifdef REF_DEBUG
-               fprintf(stderr, "[%ld refs]\n", ref_total);
+               fprintf(stderr, "[%ld refs]\n", _Py_RefTotal);
 #endif
                if (ret == E_EOF)
                        return 0;
@@ -664,7 +664,7 @@ goaway(sts)
        err_clear();
 
 #ifdef REF_DEBUG
-       fprintf(stderr, "[%ld refs]\n", ref_total);
+       fprintf(stderr, "[%ld refs]\n", _Py_RefTotal);
 #endif
 
 #ifdef TRACE_REFS