]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-118527: Intern code consts in free-threaded build (#118667)
authorSam Gross <colesbury@gmail.com>
Tue, 7 May 2024 00:12:39 +0000 (20:12 -0400)
committerGitHub <noreply@github.com>
Tue, 7 May 2024 00:12:39 +0000 (20:12 -0400)
commit723d4d2fe8e77b398f0ccffcfa541149caaac6a1
tree8d213981ac3bc060c5046acdc256015d2c821476
parent8d8275b0cf43f0e20c72a9641cbddc5044cdae04
gh-118527: Intern code consts in free-threaded build (#118667)

We already intern and immortalize most string constants. In the
free-threaded build, other constants can be a source of reference count
contention because they are shared by all threads running the same code
objects.
14 files changed:
Include/internal/pycore_code.h
Include/internal/pycore_interp.h
Include/internal/pycore_setobject.h
Lib/test/support/__init__.py
Lib/test/test_code.py
Lib/test/test_ctypes/test_internals.py
Lib/test/test_ctypes/test_python_api.py
Lib/test/test_memoryio.py
Modules/_testinternalcapi.c
Objects/codeobject.c
Objects/setobject.c
Python/bltinmodule.c
Python/pylifecycle.c
Python/pystate.c