diff options
author | Mark Shannon <mark@hotpy.org> | 2022-05-18 13:38:43 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-18 13:38:43 (GMT) |
commit | a4460f2eb8b9db46a9bce3c450c8b038038a7c93 (patch) | |
tree | 7b05dbe2f220e575f642bf5c66fa1a54478aeb32 /Include | |
parent | 3fa023721b495e02e1e6c89fdc737afc7d186cb5 (diff) | |
download | cpython-a4460f2eb8b9db46a9bce3c450c8b038038a7c93.zip cpython-a4460f2eb8b9db46a9bce3c450c8b038038a7c93.tar.gz cpython-a4460f2eb8b9db46a9bce3c450c8b038038a7c93.tar.bz2 |
Split refcount stats into 'interpreter' and 'non-interpreter' (GH-92919)
Diffstat (limited to 'Include')
-rw-r--r-- | Include/pystats.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Include/pystats.h b/Include/pystats.h index bc05dd8..4375614b 100644 --- a/Include/pystats.h +++ b/Include/pystats.h @@ -36,6 +36,8 @@ typedef struct _call_stats { typedef struct _object_stats { uint64_t increfs; uint64_t decrefs; + uint64_t interpreter_increfs; + uint64_t interpreter_decrefs; uint64_t allocations; uint64_t allocations512; uint64_t allocations4k; @@ -60,10 +62,18 @@ PyAPI_DATA(PyStats) _py_stats; extern void _Py_PrintSpecializationStats(int to_file); +#ifdef _PY_INTERPRETER + +#define _Py_INCREF_STAT_INC() _py_stats.object_stats.interpreter_increfs++ +#define _Py_DECREF_STAT_INC() _py_stats.object_stats.interpreter_decrefs++ + +#else #define _Py_INCREF_STAT_INC() _py_stats.object_stats.increfs++ #define _Py_DECREF_STAT_INC() _py_stats.object_stats.decrefs++ +#endif + #else #define _Py_INCREF_STAT_INC() ((void)0) |