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

gh-81057: Move the global Dict-Related Versions to _PyRuntimeState#99497
ericsnowcurrently merged 4 commits into
python:mainfrom
ericsnowcurrently:consolidate-obj-version-globals

Conversation

@ericsnowcurrently

@ericsnowcurrentlyericsnowcurrently 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];
intnumfree;
PyDictKeysObject*keys_free_list[PyDict_MAXFREELIST];
intkeys_numfree;
PyDictObject*free_list[PyDict_MAXFREELIST];
PyDictKeysObject*keys_free_list[PyDict_MAXFREELIST];
intnumfree;
intkeys_numfree;

Copy link
Copy Markdown
MemberAuthor

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
MemberAuthor

Choose a reason for hiding this comment

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

done

@ericsnowcurrently
ericsnowcurrentlyforce-pushed the consolidate-obj-version-globals branch from 5182895 to f684dcdCompareNovember 16, 2022 16:49
@ericsnowcurrently

Copy link
Copy Markdown
MemberAuthor

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:mainNov 16, 2022
@ericsnowcurrently
ericsnowcurrently deleted the consolidate-obj-version-globals branch November 16, 2022 17:37
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@ericsnowcurrently@methane@bedevere-bot