mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
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
This commit is contained in:
parent
8211cf5d28
commit
9db1e17c80
16 changed files with 89 additions and 48 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue