diff options
| author | Eric Snow <ericsnowcurrently@gmail.com> | 2022-11-16 10:37:29 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-16 10:37:29 -0700 |
| commit | 9db1e17c80217d7b18a2f44297d72acd10ee73d6 (patch) | |
| tree | 4d0256b80f512133b1fb6db73a68da5bdbe22c5c /Objects/funcobject.c | |
| parent | 8211cf5d287acfd815b6a7f6471cdf83dcd2bb9b (diff) | |
| download | cpython-git-9db1e17c80217d7b18a2f44297d72acd10ee73d6.tar.gz | |
gh-81057: Move the global Dict-Related Versions to _PyRuntimeState (gh-99497)
We also move the global func version.
https://github.com/python/cpython/issues/81057
Diffstat (limited to 'Objects/funcobject.c')
| -rw-r--r-- | Objects/funcobject.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Objects/funcobject.c b/Objects/funcobject.c index d60e4eb848..cab8000658 100644 --- a/Objects/funcobject.c +++ b/Objects/funcobject.c @@ -7,8 +7,6 @@ #include "pycore_pyerrors.h" // _PyErr_Occurred() #include "structmember.h" // PyMemberDef -static uint32_t next_func_version = 1; - PyFunctionObject * _PyFunction_FromConstructor(PyFrameConstructor *constr) { @@ -128,10 +126,10 @@ uint32_t _PyFunction_GetVersionForCurrentState(PyFunctionObject *func) if (func->vectorcall != _PyFunction_Vectorcall) { return 0; } - if (next_func_version == 0) { + if (_PyRuntime.func_state.next_version == 0) { return 0; } - uint32_t v = next_func_version++; + uint32_t v = _PyRuntime.func_state.next_version++; func->func_version = v; return v; } |
