diff options
| author | Mark Shannon <mark@hotpy.org> | 2023-08-04 09:34:23 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-04 09:34:23 (GMT) |
| commit | 2ba7c7f7b151ff56cf12bf3cab286981bb646c90 (patch) | |
| tree | e89d562e9043fb9703a9b822de58a9bd4bedb1ac /Include/internal/pycore_code.h | |
| parent | fa45958450aa3489607daf9855ca0474a2a20878 (diff) | |
| download | cpython-2ba7c7f7b151ff56cf12bf3cab286981bb646c90.zip cpython-2ba7c7f7b151ff56cf12bf3cab286981bb646c90.tar.gz cpython-2ba7c7f7b151ff56cf12bf3cab286981bb646c90.tar.bz2 | |
Add some GC stats to Py_STATS (GH-107581)
Diffstat (limited to 'Include/internal/pycore_code.h')
| -rw-r--r-- | Include/internal/pycore_code.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Include/internal/pycore_code.h b/Include/internal/pycore_code.h index ee1b851..0009937 100644 --- a/Include/internal/pycore_code.h +++ b/Include/internal/pycore_code.h @@ -274,6 +274,7 @@ extern int _PyStaticCode_Init(PyCodeObject *co); #define EVAL_CALL_STAT_INC(name) do { if (_py_stats) _py_stats->call_stats.eval_calls[name]++; } while (0) #define EVAL_CALL_STAT_INC_IF_FUNCTION(name, callable) \ do { if (_py_stats && PyFunction_Check(callable)) _py_stats->call_stats.eval_calls[name]++; } while (0) +#define GC_STAT_ADD(gen, name, n) do { if (_py_stats) _py_stats->gc_stats[(gen)].name += (n); } while (0) // Export for '_opcode' shared extension PyAPI_FUNC(PyObject*) _Py_GetSpecializationStats(void); @@ -287,6 +288,7 @@ PyAPI_FUNC(PyObject*) _Py_GetSpecializationStats(void); #define OBJECT_STAT_INC_COND(name, cond) ((void)0) #define EVAL_CALL_STAT_INC(name) ((void)0) #define EVAL_CALL_STAT_INC_IF_FUNCTION(name, callable) ((void)0) +#define GC_STAT_ADD(gen, name, n) ((void)0) #endif // !Py_STATS // Utility functions for reading/writing 32/64-bit values in the inline caches. |
