Avoid Standalone Sub-structs In pycore_runtime.h #125604
Labels
3.14
new features, bugs and security fixes
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
pycore_runtime.h is where the
_PyRuntimeStatestruct is declared. Nearly every one of the structs it relies on ("sub-struct") is found in the internal header file that corresponds to that struct's subject matter, rather than in pycore_runtime.h. There are only a few that are declared in pycore_runtime.h, mostly because it was easier to put them there than create the appropriate header files.In the interest of keeping the focus of pycore_runtime.h on
_PyRuntimeState, I'd like to clear out the standalone sub-structs there.The involves the following:
_Py_DebugOffsets- move to its own header file (pycore_debugger_utils.h)struct _getargs_runtime_state- inline in_PyRuntimeStatestruct _gilstate_runtime_state- inline in_PyRuntimeState_Py_AuditHookEntry- move to its own header file (pycore_audit.h); also move the other audit-related APIs to pycore_audit.h or audit.h (to be added)struct _reftracer_runtime_state- move to pycore_object_state.h_Py_DebugOffsetsis the most meaningful one to move since it is so big (visually occludes_PyRuntimeState). For_Py_AuditHookEntry, we probably should have added pycore_audit.h in the first place.Linked PRs
The text was updated successfully, but these errors were encountered: