bpo-45953: Statically initialize all the non-object PyInterpreterState fields we can. (gh-30589)

https://bugs.python.org/issue45953
This commit is contained in:
Eric Snow 2022-01-13 17:17:28 -07:00 committed by GitHub
parent 324908ba93
commit 322f962f3e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 39 additions and 25 deletions

View file

@ -281,7 +281,6 @@ init_interpreter(PyInterpreterState *interp,
assert(id > 0 || (id == 0 && interp == runtime->interpreters.main));
interp->id = id;
interp->id_refcount = -1;
assert(runtime->interpreters.head == interp);
assert(next != NULL || (interp == runtime->interpreters.main));
@ -291,14 +290,6 @@ init_interpreter(PyInterpreterState *interp,
_PyGC_InitState(&interp->gc);
PyConfig_InitPythonConfig(&interp->config);
_PyType_InitCache(interp);
interp->eval_frame = NULL;
#ifdef HAVE_DLOPEN
#if HAVE_DECL_RTLD_NOW
interp->dlopenflags = RTLD_NOW;
#else
interp->dlopenflags = RTLD_LAZY;
#endif
#endif
interp->_initialized = 1;
}