mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
gh-81057: Move Globals in Core Code to _PyRuntimeState (gh-99496)
This is the first of several changes to consolidate non-object globals in core code. https://github.com/python/cpython/issues/81057
This commit is contained in:
parent
73943cbc4c
commit
3c57971a2d
17 changed files with 235 additions and 167 deletions
|
@ -1846,9 +1846,6 @@ vgetargskeywords(PyObject *args, PyObject *kwargs, const char *format,
|
|||
}
|
||||
|
||||
|
||||
/* List of static parsers. */
|
||||
static struct _PyArg_Parser *static_arg_parsers = NULL;
|
||||
|
||||
static int
|
||||
scan_keywords(const char * const *keywords, int *ptotal, int *pposonly)
|
||||
{
|
||||
|
@ -2024,8 +2021,8 @@ _parser_init(struct _PyArg_Parser *parser)
|
|||
parser->initialized = owned ? 1 : -1;
|
||||
|
||||
assert(parser->next == NULL);
|
||||
parser->next = static_arg_parsers;
|
||||
static_arg_parsers = parser;
|
||||
parser->next = _PyRuntime.getargs.static_parsers;
|
||||
_PyRuntime.getargs.static_parsers = parser;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -2930,14 +2927,14 @@ _PyArg_NoKwnames(const char *funcname, PyObject *kwnames)
|
|||
void
|
||||
_PyArg_Fini(void)
|
||||
{
|
||||
struct _PyArg_Parser *tmp, *s = static_arg_parsers;
|
||||
struct _PyArg_Parser *tmp, *s = _PyRuntime.getargs.static_parsers;
|
||||
while (s) {
|
||||
tmp = s->next;
|
||||
s->next = NULL;
|
||||
parser_clear(s);
|
||||
s = tmp;
|
||||
}
|
||||
static_arg_parsers = NULL;
|
||||
_PyRuntime.getargs.static_parsers = NULL;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue