]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-81057: Move the Allocators to _PyRuntimeState (gh-99217)
authorEric Snow <ericsnowcurrently@gmail.com>
Fri, 11 Nov 2022 23:30:46 +0000 (16:30 -0700)
committerGitHub <noreply@github.com>
Fri, 11 Nov 2022 23:30:46 +0000 (16:30 -0700)
commit67807cfc87135fdce4992d38d2ffe3e44747e73b
treec6723686f91afa7963e1ac72729a417f2067f7f9
parent55c96e8053689c29ae28a9d2117ae37934eace68
gh-81057: Move the Allocators to _PyRuntimeState (gh-99217)

The global allocators were stored in 3 static global variables: _PyMem_Raw, _PyMem, and _PyObject.  State for the "small block" allocator was stored in another 13.  That makes a total of 16 global variables. We are moving all 16 to the _PyRuntimeState struct as part of the work for gh-81057.  (If PEP 684 is accepted then we will follow up by moving them all to PyInterpreterState.)

https://github.com/python/cpython/issues/81057
14 files changed:
Include/internal/pycore_obmalloc.h [new file with mode: 0644]
Include/internal/pycore_obmalloc_init.h [new file with mode: 0644]
Include/internal/pycore_pymem.h
Include/internal/pycore_pymem_init.h [new file with mode: 0644]
Include/internal/pycore_runtime.h
Include/internal/pycore_runtime_init.h
Makefile.pre.in
Misc/NEWS.d/next/Core and Builtins/2022-11-07-14-16-59.gh-issue-81057.3uKlLQ.rst [new file with mode: 0644]
Objects/obmalloc.c
PCbuild/pythoncore.vcxproj
PCbuild/pythoncore.vcxproj.filters
Python/pylifecycle.c
Python/pystate.c
Tools/c-analyzer/cpython/globals-to-fix.tsv