mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
bpo-36710: Add PyInterpreterState.runtime field (GH-17270)
Add PyInterpreterState.runtime field: reference to the _PyRuntime global variable. This field exists to not have to pass runtime in addition to tstate to a function. Get runtime from tstate: tstate->interp->runtime. Remove "_PyRuntimeState *runtime" parameter from functions already taking a "PyThreadState *tstate" parameter. _PyGC_Init() first parameter becomes "PyThreadState *tstate".
This commit is contained in:
parent
eb1cbbff1c
commit
01b1cc12e7
8 changed files with 81 additions and 94 deletions
|
@ -62,6 +62,11 @@ struct _is {
|
|||
struct _is *next;
|
||||
struct _ts *tstate_head;
|
||||
|
||||
/* Reference to the _PyRuntime global variable. This field exists
|
||||
to not have to pass runtime in addition to tstate to a function.
|
||||
Get runtime from tstate: tstate->interp->runtime. */
|
||||
struct pyruntimestate *runtime;
|
||||
|
||||
int64_t id;
|
||||
int64_t id_refcount;
|
||||
int requires_idref;
|
||||
|
@ -301,7 +306,6 @@ PyAPI_FUNC(void) _PyRuntime_Finalize(void);
|
|||
/* Other */
|
||||
|
||||
PyAPI_FUNC(void) _PyThreadState_Init(
|
||||
_PyRuntimeState *runtime,
|
||||
PyThreadState *tstate);
|
||||
PyAPI_FUNC(void) _PyThreadState_DeleteExcept(
|
||||
_PyRuntimeState *runtime,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue