]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-122417: Implement per-thread heap type refcounts (#122418)
authorSam Gross <colesbury@gmail.com>
Tue, 6 Aug 2024 18:36:57 +0000 (14:36 -0400)
committerGitHub <noreply@github.com>
Tue, 6 Aug 2024 18:36:57 +0000 (14:36 -0400)
commitdc093010672207176857a747c61da9c046ad9d3e
tree3eeff2ad72faa7781255016cc0f54c45aecd41d7
parent1429651a06611a9dbcb1928b746faf52934c12e2
gh-122417: Implement per-thread heap type refcounts (#122418)

The free-threaded build partially stores heap type reference counts in
distributed manner in per-thread arrays. This avoids reference count
contention when creating or destroying instances.

Co-authored-by: Ken Jin <kenjin@python.org>
18 files changed:
Include/cpython/object.h
Include/internal/pycore_gc.h
Include/internal/pycore_interp.h
Include/internal/pycore_object.h
Include/internal/pycore_tstate.h
Include/internal/pycore_typeid.h [new file with mode: 0644]
Lib/test/test_sys.py
Makefile.pre.in
Misc/NEWS.d/next/Core_and_Builtins/2024-07-29-19-20-25.gh-issue-122417.NVgs0a.rst [new file with mode: 0644]
Objects/object.c
Objects/typeobject.c
PCbuild/_freeze_module.vcxproj
PCbuild/_freeze_module.vcxproj.filters
PCbuild/pythoncore.vcxproj
PCbuild/pythoncore.vcxproj.filters
Python/gc_free_threading.c
Python/pystate.c
Python/typeid.c [new file with mode: 0644]