diff options
author | Brett Simmers <swtaarrs@users.noreply.github.com> | 2024-02-20 14:57:48 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-20 14:57:48 (GMT) |
commit | 0749244d13412d7cb5b53d834f586f2198f5b9a6 (patch) | |
tree | 06387c5b41cd14cdf230f71eab6fd92873c3d5a9 /Include/internal/pycore_gc.h | |
parent | e71468ba4f5fb2da0cefe9e923b01811cb53fb5f (diff) | |
download | cpython-0749244d13412d7cb5b53d834f586f2198f5b9a6.zip cpython-0749244d13412d7cb5b53d834f586f2198f5b9a6.tar.gz cpython-0749244d13412d7cb5b53d834f586f2198f5b9a6.tar.bz2 |
gh-112175: Add `eval_breaker` to `PyThreadState` (#115194)
This change adds an `eval_breaker` field to `PyThreadState`. The primary
motivation is for performance in free-threaded builds: with thread-local eval
breakers, we can stop a specific thread (e.g., for an async exception) without
interrupting other threads.
The source of truth for the global instrumentation version is stored in the
`instrumentation_version` field in PyInterpreterState. Threads usually read the
version from their local `eval_breaker`, where it continues to be colocated
with the eval breaker bits.
Diffstat (limited to 'Include/internal/pycore_gc.h')
-rw-r--r-- | Include/internal/pycore_gc.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Include/internal/pycore_gc.h b/Include/internal/pycore_gc.h index a98864f..40414a8 100644 --- a/Include/internal/pycore_gc.h +++ b/Include/internal/pycore_gc.h @@ -286,7 +286,7 @@ extern PyObject *_PyGC_GetReferrers(PyInterpreterState *interp, PyObject *objs); // Functions to clear types free lists extern void _PyGC_ClearAllFreeLists(PyInterpreterState *interp); -extern void _Py_ScheduleGC(PyInterpreterState *interp); +extern void _Py_ScheduleGC(PyThreadState *tstate); extern void _Py_RunGC(PyThreadState *tstate); #ifdef __cplusplus |