8000 GH-122548: Implement branch taken and not taken events for sys.monitoring by markshannon · Pull Request #122564 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

GH-122548: Implement branch taken and not taken events for sys.monitoring #122564

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Dec 19, 2024
Merged
Prev Previous commit
Next Next commit
Fix reference counting in _PyMonitoring_RegisterCallback
  • Loading branch information
markshannon committed Dec 13, 2024
commit 2814c23c041d2e9fa98b69e2c2bea9047c1d7fd5
4 changes: 2 additions & 2 deletions Python/instrumentation.c
Original file line number Diff line number Diff line change
Expand Up @@ -2932,11 +2932,11 @@ static PyObject *make_branch_handler(int tool_id, PyObject *handler, bool right)
return (PyObject *)callback;
}

/* Consumes a reference to obj */
static PyObject *exchange_callables(int tool_id, int event_id, PyObject *obj)
{
PyInterpreterState *is = _PyInterpreterState_GET();
return _Py_atomic_exchange_ptr(&is->monitoring_callables[tool_id][event_id],
Py_XNewRef(obj));
return _Py_atomic_exchange_ptr(&is->monitoring_callables[tool_id][event_id], obj);
}

PyObject *
Expand Down
0