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" {
1010
1111#define FUNC_MAX_WATCHERS 8
1212
13- struct _py_func_runtime_state {
13+ struct _py_func_state {
1414 uint32_t next_version ;
1515};
1616
Original file line number Diff line number Diff line change @@ -141,6 +141,7 @@ struct _is {
141141 struct _Py_float_state float_state ;
142142 struct _Py_long_state long_state ;
143143 struct _dtoa_state dtoa ;
144+ struct _py_func_state func_state ;
144145 /* Using a cache is very effective since typically only a single slice is
145146 created and then deleted again. */
146147 PySliceObject * slice_cache ;
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ extern "C" {
1313#include "pycore_dict_state.h" // struct _Py_dict_runtime_state
1414#include "pycore_floatobject.h" // struct _Py_float_runtime_state
1515#include "pycore_faulthandler.h" // struct _faulthandler_runtime_state
16- #include "pycore_function.h" // struct _func_runtime_state
1716#include "pycore_global_objects.h" // struct _Py_global_objects
1817#include "pycore_import.h" // struct _import_runtime_state
1918#include "pycore_interp.h" // PyInterpreterState
@@ -155,7 +154,6 @@ typedef struct pyruntimestate {
155154 struct _Py_float_runtime_state float_state ;
156155 struct _Py_unicode_runtime_state unicode_state ;
157156 struct _Py_dict_runtime_state dict_state ;
158- struct _py_func_runtime_state func_state ;
159157
160158 struct {
161159 /* 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;
6868 .dict_state = { \
6969 .next_keys_version = 2, \
7070 }, \
71- .func_state = { \
72- .next_version = 1, \
73- }, \
7471 .types = { \
7572 .next_version_tag = 1, \
7673 }, \
@@ -116,6 +113,9 @@ extern PyTypeObject _PyExc_MemoryError;
116113 }, \
117114 }, \
118115 .dtoa = _dtoa_state_INIT(&(INTERP)), \
116+ .func_state = { \
117+ .next_version = 1, \
118+ }, \
119119 .static_objects = { \
120120 .singletons = { \
121121 ._not_used = 1, \
Original file line number Diff line number Diff line change @@ -227,10 +227,11 @@ uint32_t _PyFunction_GetVersionForCurrentState(PyFunctionObject *func)
227227 if (func -> vectorcall != _PyFunction_Vectorcall ) {
228228 return 0 ;
229229 }
230- if (_PyRuntime .func_state .next_version == 0 ) {
230+ PyInterpreterState * interp = _PyInterpreterState_GET ();
231+ if (interp -> func_state .next_version == 0 ) {
231232 return 0 ;
232233 }
233- uint32_t v = _PyRuntime . func_state .next_version ++ ;
234+ uint32_t v = interp -> func_state .next_version ++ ;
234235 func -> func_version = v ;
235236 return v ;
236237}
You can’t perform that action at this time.
0 commit comments