mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
gh-87347: Add parenthesis around macro arguments (#93915)
Add unit test on Py_MEMBER_SIZE() and some other macros.
This commit is contained in:
parent
61f24e7885
commit
7ad6f74fcf
30 changed files with 171 additions and 143 deletions
|
|
@ -252,16 +252,16 @@ extern int _PyStaticCode_InternStrings(PyCodeObject *co);
|
|||
#ifdef Py_STATS
|
||||
|
||||
|
||||
#define STAT_INC(opname, name) _py_stats.opcode_stats[opname].specialization.name++
|
||||
#define STAT_DEC(opname, name) _py_stats.opcode_stats[opname].specialization.name--
|
||||
#define OPCODE_EXE_INC(opname) _py_stats.opcode_stats[opname].execution_count++
|
||||
#define STAT_INC(opname, name) _py_stats.opcode_stats[(opname)].specialization.name++
|
||||
#define STAT_DEC(opname, name) _py_stats.opcode_stats[(opname)].specialization.name--
|
||||
#define OPCODE_EXE_INC(opname) _py_stats.opcode_stats[(opname)].execution_count++
|
||||
#define CALL_STAT_INC(name) _py_stats.call_stats.name++
|
||||
#define OBJECT_STAT_INC(name) _py_stats.object_stats.name++
|
||||
#define OBJECT_STAT_INC_COND(name, cond) \
|
||||
do { if (cond) _py_stats.object_stats.name++; } while (0)
|
||||
#define EVAL_CALL_STAT_INC(name) _py_stats.call_stats.eval_calls[name]++
|
||||
#define EVAL_CALL_STAT_INC(name) _py_stats.call_stats.eval_calls[(name)]++
|
||||
#define EVAL_CALL_STAT_INC_IF_FUNCTION(name, callable) \
|
||||
do { if (PyFunction_Check(callable)) _py_stats.call_stats.eval_calls[name]++; } while (0)
|
||||
do { if (PyFunction_Check(callable)) _py_stats.call_stats.eval_calls[(name)]++; } while (0)
|
||||
|
||||
// Used by the _opcode extension which is built as a shared library
|
||||
PyAPI_FUNC(PyObject*) _Py_GetSpecializationStats(void);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue