summaryrefslogtreecommitdiffstats
path: root/Python/generated_cases.c.h
diff options
context:
space:
mode:
authorSam Gross <colesbury@gmail.com>2024-09-12 16:37:06 (GMT)
committerGitHub <noreply@github.com>2024-09-12 16:37:06 (GMT)
commitb2afe2aae487ebf89897e22c01d9095944fd334f (patch)
tree3ffa3ebfe3c69cd21968ce76d8d7cb2f325ff6d3 /Python/generated_cases.c.h
parent4ed7d1d6acc22807bfb5983c98fd59f7cb5061db (diff)
downloadcpython-b2afe2aae487ebf89897e22c01d9095944fd334f.zip
cpython-b2afe2aae487ebf89897e22c01d9095944fd334f.tar.gz
cpython-b2afe2aae487ebf89897e22c01d9095944fd334f.tar.bz2
gh-123923: Defer refcounting for `f_executable` in `_PyInterpreterFrame` (#123924)
Use a `_PyStackRef` and defer the reference to `f_executable` when possible. This avoids some reference count contention in the common case of executing the same code object from multiple threads concurrently in the free-threaded build.
Diffstat (limited to 'Python/generated_cases.c.h')
-rw-r--r--Python/generated_cases.c.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h
index 09a14ee..3e9f039 100644
--- a/Python/generated_cases.c.h
+++ b/Python/generated_cases.c.h
@@ -1018,7 +1018,7 @@
{
_PyInterpreterFrame *shim = _PyFrame_PushTrampolineUnchecked(
tstate, (PyCodeObject *)&_Py_InitCleanup, 1, frame);
- assert(_PyCode_CODE((PyCodeObject *)shim->f_executable)[0].op.code == EXIT_INIT_CHECK);
+ assert(_PyCode_CODE(_PyFrame_GetCode(shim))[0].op.code == EXIT_INIT_CHECK);
/* Push self onto stack of shim */
shim->localsplus[0] = PyStackRef_DUP(self);
PyFunctionObject *init_func = (PyFunctionObject *)PyStackRef_AsPyObjectSteal(init);