The Last Fields of PyInterpreterState and of _PyRuntimeState Should Not Change #127117
Labels
3.14
new features, bugs and security fixes
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
type-bug
An unexpected behavior, bug, or error
The last field of
PyInterpreterState
should be_initial_thread
and the last field of_PyRuntimeState
should be_main_interpreter
. Respectively, they are the preallocated struct values that are used for the "main" thread and main interpreter.Having them at the end simplifies some backporting scenarios. It also gives better locality to all the state in the respective interpreter/runtime; otherwise any fields after
_initial_thread
or_main_interpreter
will be separated from the rest by those structs.I'll make sure there's a note on each struct and that any out-of-place fields are moved up.
Linked PRs
The text was updated successfully, but these errors were encountered: