[WIP] bpo-39465: Optimize _PyInterpreterState_GET() by vstinner · Pull Request #20767 · python/cpython · GitHub
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 43 additions & 19 deletions Include/internal/pycore_pystate.h
3 changes: 3 additions & 0 deletions Include/internal/pycore_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ struct _gilstate_runtime_state {
/* Assuming the current thread holds the GIL, this is the
PyThreadState for the current thread. */
_Py_atomic_address tstate_current;
/* Assuming the current thread holds the GIL, this is the
PyInterpreterState of tstate_current. */
_Py_atomic_address interp_current;
/* The single PyInterpreterState used by this process'
GILState implementation
*/
Expand Down
7 changes: 7 additions & 0 deletions Python/pystate.c