]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-131253: free-threaded build support for pystats (gh-137189)
authorNeil Schemenauer <nas-github@arctrix.com>
Mon, 3 Nov 2025 19:36:37 +0000 (11:36 -0800)
committerGitHub <noreply@github.com>
Mon, 3 Nov 2025 19:36:37 +0000 (11:36 -0800)
commitc98c5b344941c45e50dded708177f7ec2e225b2b
tree43c5f724754659bcf206d095eb1290bb4138f8e7
parentcf1a2c1ee46b62fb3a5938fdfe90b7a9df312c3a
gh-131253: free-threaded build support for pystats (gh-137189)

Allow the --enable-pystats build option to be used with free-threading.  The
stats are now stored on a per-interpreter basis, rather than process global.
For free-threaded builds, the stats structure is allocated per-thread and
then periodically merged into the per-interpreter stats structure (on thread
exit or when the reporting function is called). Most of the pystats related
code has be moved into the file Python/pystats.c.
24 files changed:
Include/cpython/pystate.h
Include/cpython/pystats.h
Include/internal/pycore_interp_structs.h
Include/internal/pycore_pystats.h
Include/internal/pycore_stats.h
Include/internal/pycore_tstate.h
Lib/test/test_pystats.py [new file with mode: 0644]
Makefile.pre.in
Misc/NEWS.d/next/Core_and_Builtins/2025-07-29-17-51-14.gh-issue-131253.GpRjWy.rst [new file with mode: 0644]
Modules/_xxtestfuzz/fuzzer.c
PCbuild/_freeze_module.vcxproj
PCbuild/_freeze_module.vcxproj.filters
PCbuild/pythoncore.vcxproj
Python/ceval_macros.h
Python/gc.c
Python/gc_free_threading.c
Python/initconfig.c
Python/lock.c
Python/pylifecycle.c
Python/pystate.c
Python/pystats.c [new file with mode: 0644]
Python/qsbr.c
Python/specialize.c
Python/sysmodule.c