]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-123923: Defer refcounting for `f_executable` in `_PyInterpreterFrame` (#123924)
authorSam Gross <colesbury@gmail.com>
Thu, 12 Sep 2024 16:37:06 +0000 (12:37 -0400)
committerGitHub <noreply@github.com>
Thu, 12 Sep 2024 16:37:06 +0000 (12:37 -0400)
commitb2afe2aae487ebf89897e22c01d9095944fd334f
tree3ffa3ebfe3c69cd21968ce76d8d7cb2f325ff6d3
parent4ed7d1d6acc22807bfb5983c98fd59f7cb5061db
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.
18 files changed:
Include/internal/pycore_frame.h
Include/internal/pycore_gc.h
Include/internal/pycore_stackref.h
Lib/test/test_generators.py
Misc/NEWS.d/next/Core_and_Builtins/2024-09-10-20-25-00.gh-issue-123923.A7uxqa.rst [new file with mode: 0644]
Modules/_testexternalinspection.c
Objects/frameobject.c
Objects/genobject.c
Python/bytecodes.c
Python/ceval.c
Python/executor_cases.c.h
Python/frame.c
Python/gc.c
Python/gc_free_threading.c
Python/generated_cases.c.h
Python/legacy_tracing.c
Python/tracemalloc.c
Tools/gdb/libpython.py