bpo-45953: Statically initialize the small ints. (gh-30092)

The array of small PyLong objects has been statically declared. Here I also statically initialize them. Consequently they are no longer initialized dynamically during runtime init.

I've also moved them under a new sub-struct in _PyRuntimeState, in preparation for static allocation and initialization of other global objects.

https://bugs.python.org/issue45953
This commit is contained in:
Eric Snow 2021-12-13 18:04:05 -07:00 committed by GitHub
parent cb589d1b6b
commit 121f1f893a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 360 additions and 81 deletions

View file

@ -676,8 +676,6 @@ pycore_init_global_objects(PyInterpreterState *interp)
{
PyStatus status;
_PyLong_InitGlobalObjects(interp);
_PyFloat_InitState(interp);
status = _PyBytes_InitGlobalObjects(interp);