File tree Expand file tree Collapse file tree 5 files changed +8
-8
lines changed Expand file tree Collapse file tree 5 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ extern "C" {
10
10
11
11
#define FUNC_MAX_WATCHERS 8
12
12
13
- struct _py_func_runtime_state {
13
+ struct _py_func_state {
14
14
uint32_t next_version ;
15
15
};
16
16
Original file line number Diff line number Diff line change @@ -141,6 +141,7 @@ struct _is {
141
141
struct _Py_float_state float_state ;
142
142
struct _Py_long_state long_state ;
143
143
struct _dtoa_state dtoa ;
144
+ struct _py_func_state func_state ;
144
145
/* Using a cache is very effective since typically only a single slice is
145
146
created and then deleted again. */
146
147
PySliceObject * slice_cache ;
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ extern "C" {
13
13
#include "pycore_dict_state.h" // struct _Py_dict_runtime_state
14
14
#include "pycore_floatobject.h" // struct _Py_float_runtime_state
15
15
#include "pycore_faulthandler.h" // struct _faulthandler_runtime_state
16
- #include "pycore_function.h" // struct _func_runtime_state
17
16
#include "pycore_global_objects.h" // struct _Py_global_objects
18
17
#include "pycore_import.h" // struct _import_runtime_state
19
18
#include "pycore_interp.h" // PyInterpreterState
@@ -155,7 +154,6 @@ typedef struct pyruntimestate {
155
154
struct _Py_float_runtime_state float_state ;
156
155
struct _Py_unicode_runtime_state unicode_state ;
157
156
struct _Py_dict_runtime_state dict_state ;
158
- struct _py_func_runtime_state func_state ;
159
157
160
158
struct {
161
159
/* Used to set PyTypeObject.tp_version_tag */
Original file line number Diff line number Diff line change @@ -68,9 +68,6 @@ extern PyTypeObject _PyExc_MemoryError;
68
68
.dict_state = { \
69
69
.next_keys_version = 2, \
70
70
}, \
71
- .func_state = { \
72
- .next_version = 1, \
73
- }, \
74
71
.types = { \
75
72
.next_version_tag = 1, \
76
73
}, \
@@ -116,6 +113,9 @@ extern PyTypeObject _PyExc_MemoryError;
116
113
}, \
117
114
}, \
118
115
.dtoa = _dtoa_state_INIT(&(INTERP)), \
116
+ .func_state = { \
117
+ .next_version = 1, \
118
+ }, \
119
119
.static_objects = { \
120
120
.singletons = { \
121
121
._not_used = 1, \
Original file line number Diff line number Diff line change @@ -227,10 +227,11 @@ uint32_t _PyFunction_GetVersionForCurrentState(PyFunctionObject *func)
227
227
if (func -> vectorcall != _PyFunction_Vectorcall ) {
228
228
return 0 ;
229
229
}
230
- if (_PyRuntime .func_state .next_version == 0 ) {
230
+ PyInterpreterState * interp = _PyInterpreterState_GET ();
231
+ if (interp -> func_state .next_version == 0 ) {
231
232
return 0 ;
232
233
}
233
- uint32_t v = _PyRuntime . func_state .next_version ++ ;
234
+ uint32_t v = interp -> func_state .next_version ++ ;
234
235
func -> func_version = v ;
235
236
return v ;
236
237
}
You can’t perform that action at this time.
0 commit comments