Skip to content

Commit 1a3e836

Browse files
Add PyInterpreterState.runtime field.
1 parent 9df3267 commit 1a3e836

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Include/internal/pycore_pystate.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ extern "C" {
1919
#include "pycore_pymem.h"
2020
#include "pycore_warnings.h"
2121

22+
// forward
23+
struct pyruntimestate;
24+
2225

2326
/* ceval state */
2427

@@ -68,6 +71,7 @@ struct _is {
6871

6972
struct _is *next;
7073
struct _ts *tstate_head;
74+
struct pyruntimestate *runtime;
7175

7276
int64_t id;
7377
int64_t id_refcount;

Python/pystate.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,9 @@ PyInterpreterState_New(void)
202202
}
203203

204204
memset(interp, 0, sizeof(*interp));
205+
206+
interp->runtime = &_PyRuntime;
207+
205208
interp->id_refcount = -1;
206209
interp->check_interval = 100;
207210

0 commit comments

Comments
 (0)