]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-123923: Defer refcounting for `f_funcobj` in `_PyInterpreterFrame` (#124026)
authorSam Gross <colesbury@gmail.com>
Tue, 24 Sep 2024 20:08:18 +0000 (13:08 -0700)
committerGitHub <noreply@github.com>
Tue, 24 Sep 2024 20:08:18 +0000 (20:08 +0000)
commitf4997bb3ac961d6aaf07ce650cd074e28ce6ccd0
tree6c82b0fadd282e74c8f81de4a3966666fd210196
parentd3c76dff444046504754a437dceebc9a9c87ef18
gh-123923: Defer refcounting for `f_funcobj` in `_PyInterpreterFrame` (#124026)

Use a `_PyStackRef` and defer the reference to `f_funcobj` 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.
17 files changed:
Include/internal/pycore_frame.h
Include/internal/pycore_gc.h
Modules/_testinternalcapi.c
Objects/frameobject.c
Objects/genobject.c
Objects/typevarobject.c
Python/bytecodes.c
Python/ceval.c
Python/executor_cases.c.h
Python/frame.c
Python/gc_free_threading.c
Python/generated_cases.c.h
Python/optimizer.c
Python/optimizer_analysis.c
Python/sysmodule.c
Tools/cases_generator/analyzer.py
Tools/cases_generator/generators_common.py