GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-81057: Move the global Dict-Related Versions to _PyRuntimeState by ericsnowcurrently · Pull Request #99497 · python/cpython

Conversation

@ericsnowcurrently

@ericsnowcurrently ericsnowcurrently commented Nov 14, 2022 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

We also move the global func version.

  • Issue: [subinterpreters] Global C variables are a problem #81057

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ericsnowcurrently ericsnowcurrently added the skip news label Nov 14, 2022
@ericsnowcurrently
ericsnowcurrently requested review from a team, markshannon, methane and rhettinger as code owners November 14, 2022 23:51
@bedevere-bot bedevere-bot added the awaiting core review label Nov 14, 2022
@bedevere-bot bedevere-bot mentioned this pull request Nov 14, 2022
[subinterpreters] Global C variables are a problem #81057
Closed
@ericsnowcurrently
ericsnowcurrently requested review from carljm and markshannon and removed request for a team, markshannon, methane and rhettinger November 14, 2022 23:51
methane
methane reviewed Nov 16, 2022
View reviewed changes
Comment thread Include/internal/pycore_dict_state.h
Comment on lines +35 to +38
PyDictObject *free_list[PyDict_MAXFREELIST];
int numfree;
PyDictKeysObject *keys_free_list[PyDict_MAXFREELIST];
int keys_numfree;

@methane methane Nov 16, 2022

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

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;

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@ericsnowcurrently ericsnowcurrently Nov 16, 2022

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@ericsnowcurrently ericsnowcurrently Nov 16, 2022

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

done

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
methane
methane approved these changes Nov 16, 2022
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels Nov 16, 2022
ericsnowcurrently added 4 commits November 16, 2022 09:42
@ericsnowcurrently
Move next_dict_keys_version to _PyRuntimeState.
c00d1e0
@ericsnowcurrently
Move _pydict_global_version to _PyRuntimeState.
a937251
@ericsnowcurrently
Move next_func_version to _PyRuntimeState.
ba9e889
@ericsnowcurrently
Make "struct _Py_dict_state" a little more compact.
f684dcd
@ericsnowcurrently
ericsnowcurrently force-pushed the consolidate-obj-version-globals branch from 5182895 to f684dcd Compare November 16, 2022 16:49
@ericsnowcurrently

ericsnowcurrently commented Nov 16, 2022

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. 😄

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ericsnowcurrently
ericsnowcurrently merged commit 9db1e17 into python:main Nov 16, 2022
@bedevere-bot bedevere-bot removed the awaiting merge label 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

Reviewers

@methane methane methane approved these changes
@carljm carljm Awaiting requested review from carljm
@markshannon markshannon Awaiting requested review from markshannon markshannon is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@ericsnowcurrently @methane @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.