]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-124218: Use per-thread refcounts for code objects (#125216)
authorSam Gross <colesbury@gmail.com>
Tue, 15 Oct 2024 19:06:41 +0000 (15:06 -0400)
committerGitHub <noreply@github.com>
Tue, 15 Oct 2024 19:06:41 +0000 (15:06 -0400)
commit3ea488aac44887a7cdb30be69580c81a0ca6afe2
tree925b843905d373016f38c08431a7658fd10db081
parent206de4155b01f6285c5551d2224391fa1fa0ac14
gh-124218: Use per-thread refcounts for code objects (#125216)

Use per-thread refcounting for the reference from function objects to
their corresponding code object. This can be a source of contention when
frequently creating nested functions. Deferred refcounting alone isn't a
great fit here because these references are on the heap and may be
modified by other libraries.
Include/cpython/code.h
Include/cpython/object.h
Include/internal/pycore_object.h
Include/internal/pycore_uniqueid.h
Objects/codeobject.c
Objects/funcobject.c
Objects/typeobject.c
Python/gc_free_threading.c
Python/pylifecycle.c
Python/pystate.c
Python/uniqueid.c