Split refcount stats into 'interpreter' and 'non-interpreter' (GH-92919)

This commit is contained in:
Mark Shannon 2022-05-18 14:38:43 +01:00 committed by GitHub
parent 3fa023721b
commit a4460f2eb8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 24 additions and 0 deletions

View file

@ -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)