mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Split refcount stats into 'interpreter' and 'non-interpreter' (GH-92919)
This commit is contained in:
parent
3fa023721b
commit
a4460f2eb8
6 changed files with 24 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue