mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
gh-118692: Avoid creating unnecessary StopIteration instances for monitoring (#119216)
This commit is contained in:
parent
b64182550f
commit
6e9863d7a3
10 changed files with 60 additions and 35 deletions
|
@ -101,7 +101,7 @@ PyAPI_FUNC(int)
|
|||
_PyMonitoring_FirePyUnwindEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset);
|
||||
|
||||
PyAPI_FUNC(int)
|
||||
_PyMonitoring_FireStopIterationEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset);
|
||||
_PyMonitoring_FireStopIterationEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset, PyObject *value);
|
||||
|
||||
|
||||
#define _PYMONITORING_IF_ACTIVE(STATE, X) \
|
||||
|
@ -240,11 +240,11 @@ PyMonitoring_FirePyUnwindEvent(PyMonitoringState *state, PyObject *codelike, int
|
|||
}
|
||||
|
||||
static inline int
|
||||
PyMonitoring_FireStopIterationEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset)
|
||||
PyMonitoring_FireStopIterationEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset, PyObject *value)
|
||||
{
|
||||
_PYMONITORING_IF_ACTIVE(
|
||||
state,
|
||||
_PyMonitoring_FireStopIterationEvent(state, codelike, offset));
|
||||
_PyMonitoring_FireStopIterationEvent(state, codelike, offset, value));
|
||||
}
|
||||
|
||||
#undef _PYMONITORING_IF_ACTIVE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue