mirror of
https://github.com/python/cpython.git
synced 2026-01-26 01:02:13 +00:00
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
This commit is contained in:
parent
758b74e71e
commit
32a67246b0
4 changed files with 309 additions and 113 deletions
|
|
@ -77,6 +77,12 @@ struct _ts {
|
|||
struct _ts *next;
|
||||
PyInterpreterState *interp;
|
||||
|
||||
/* Has been initialized to a safe state.
|
||||
|
||||
In order to be effective, this must be set to 0 during or right
|
||||
after allocation. */
|
||||
int _initialized;
|
||||
|
||||
int recursion_remaining;
|
||||
int recursion_limit;
|
||||
int recursion_headroom; /* Allow 50 more calls to handle any errors. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue