Skip to content

gh-81057: Move the global Dict-Related Versions to _PyRuntimeState - #99497

Merged
ericsnowcurrently merged 4 commits into
python:mainfrom
ericsnowcurrently:consolidate-obj-version-globals
Nov 16, 2022
Merged

ericsnowcurrently merged 4 commits into
python:mainfrom
ericsnowcurrently:consolidate-obj-version-globals

Conversation

@ericsnowcurrently

@ericsnowcurrently ericsnowcurrently commented Nov 14, 2022 •

Copy link
Copy Markdown
Member

We also move the global func version.

Comment on lines +35 to +38
PyDictObject *free_list[PyDict_MAXFREELIST];
int numfree;
PyDictKeysObject *keys_free_list[PyDict_MAXFREELIST];
int keys_numfree;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How about reorder members to make struct compact?

Suggested change
PyDictObject *free_list[PyDict_MAXFREELIST];
int numfree;
PyDictKeysObject *keys_free_list[PyDict_MAXFREELIST];
int keys_numfree;
PyDictObject *free_list[PyDict_MAXFREELIST];
PyDictKeysObject *keys_free_list[PyDict_MAXFREELIST];
int numfree;
int keys_numfree;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I don't mind doing that, but it isn't much related to this PR and I was trying to minimize extra changes. That said, it is a fairly small and simple change so I'll go ahead and do it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done

@ericsnowcurrently
ericsnowcurrently force-pushed the consolidate-obj-version-globals branch from 5182895 to f684dcd Compare November 16, 2022 16:49
@ericsnowcurrently

Copy link
Copy Markdown
Member Author

Thanks for the review, @methane! For a domain-specific change to a complex component like this, it really helps to get an expert review, even if the change seems correct and straight-forward to me. 😄

@ericsnowcurrently
ericsnowcurrently merged commit 9db1e17 into python:main Nov 16, 2022
@ericsnowcurrently
ericsnowcurrently deleted the consolidate-obj-version-globals branch November 16, 2022 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants