]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-46008: Move Py*State init into distinct functions. (gh-29977)
authorEric Snow <ericsnowcurrently@gmail.com>
Wed, 8 Dec 2021 01:59:49 +0000 (18:59 -0700)
committerGitHub <noreply@github.com>
Wed, 8 Dec 2021 01:59:49 +0000 (18:59 -0700)
commit32a67246b0d1e08cd50fc3bfa58052cfeb515b2e
treeefd97b5d0ef22b321787f47ad8b38acd352678fa
parent758b74e71eb22e1e83a9eb937d1c015e461745a1
bpo-46008: Move Py*State init into distinct functions. (gh-29977)

Previously, basic initialization of PyInterprterState happened in PyInterpreterState_New() (along with allocation and adding the new interpreter to the runtime state). This prevented us from initializing interpreter states that were allocated separately (e.g. statically or in a free list). We've addressed that here by factoring out a separate function just for initialization. We've done the same for PyThreadState. _PyRuntimeState was sorted out when we added it since _PyRuntime is statically allocated. However, here we update the existing init code to line up with the functions for PyInterpreterState and PyThreadState.

https://bugs.python.org/issue46008
Include/cpython/pystate.h
Include/internal/pycore_interp.h
Include/internal/pycore_runtime.h
Python/pystate.c