Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-45953: Statically initialize the small ints. #30092

Merged

Conversation

ericsnowcurrently
Copy link
Member

@ericsnowcurrently ericsnowcurrently commented Dec 13, 2021

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.

FWIW, I considered adding a script for generating the array initializer, but figured that can be done separately if valuable.

https://bugs.python.org/issue45953

Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I have a nit in a comment but it was present in the original before the move as well.

Include/internal/pycore_global_objects.h Outdated Show resolved Hide resolved
@ericsnowcurrently ericsnowcurrently force-pushed the global-objects-small-ints branch from a20f308 to 8f10ad0 Compare December 13, 2021 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants