Mercurial > cpython-lru_cache-weakref
diff Python/pythonrun.c @ 36837:3a3aed49b245 legacy-trunk
Use Py_ssize_t for _Py_RefTotal.
I tried to handle Win64 properly, but please review.
| author | Neal Norwitz <nnorwitz@gmail.com> |
|---|---|
| date | Sat, 04 Mar 2006 19:58:13 +0000 |
| parents | 01bc8ee3d2ff |
| children | 4284b3324ce2 |
line wrap: on
line diff
--- a/Python/pythonrun.c Sat Mar 04 19:01:22 2006 +0000 +++ b/Python/pythonrun.c Sat Mar 04 19:58:13 2006 +0000 @@ -29,6 +29,16 @@ #include "windows.h" #endif +#ifndef Py_REF_DEBUG +# define PRINT_TOTAL_REFS() +#else /* Py_REF_DEBUG */ +# if defined(MS_WIN64) +# define PRINT_TOTAL_REFS() fprintf(stderr, "[%zd refs]\n", _Py_RefTotal); +# else /* ! MS_WIN64 */ +# define PRINT_TOTAL_REFS() fprintf(stderr, "[%ld refs]\n", _Py_RefTotal); +# endif /* MS_WIN64 */ +#endif + extern char *Py_GetPath(void); extern grammar _PyParser_Grammar; /* From graminit.c */ @@ -382,9 +392,7 @@ dump_counts(); #endif -#ifdef Py_REF_DEBUG - fprintf(stderr, "[%ld refs]\n", _Py_RefTotal); -#endif + PRINT_TOTAL_REFS() #ifdef Py_TRACE_REFS /* Display all objects still alive -- this can invoke arbitrary @@ -674,9 +682,7 @@ } for (;;) { ret = PyRun_InteractiveOneFlags(fp, filename, flags); -#ifdef Py_REF_DEBUG - fprintf(stderr, "[%ld refs]\n", _Py_RefTotal); -#endif + PRINT_TOTAL_REFS() if (ret == E_EOF) return 0; /*
