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

gh-124218: Refactor per-thread reference counting #124844

Merged
merged 4 commits into from
Oct 1, 2024

Conversation

colesbury
Copy link
Contributor

@colesbury colesbury commented Oct 1, 2024

Currently, we only use per-thread reference counting for heap type objects and the naming reflects that. We will extend it to a few additional types in an upcoming change to avoid scaling bottlenecks when creating nested functions.

Rename some of the files and functions in preparation for this change.

Copy link
Member

@Fidget-Spinner Fidget-Spinner left a comment

Choose a reason for hiding this comment

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

LGTM. Mostly just moving files around.

Comment on lines +190 to +192
if (PyType_Check(obj)) {
assert(PyType_HasFeature((PyTypeObject *)obj, Py_TPFLAGS_HEAPTYPE));
((PyHeapTypeObject *)obj)->unique_id = -1;
Copy link
Member

Choose a reason for hiding this comment

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

Ah cool so you made it more general to support not just types? Got it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, we want to support it on code objects and certain dictionaries (globals, builtins). Option 2a from the linked issue: #124218.

@colesbury colesbury added the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Oct 1, 2024
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @colesbury for commit e5ec9f7 🤖

If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again.

@colesbury colesbury marked this pull request as ready for review October 1, 2024 13:36
@bedevere-bot bedevere-bot removed the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Oct 1, 2024
@colesbury colesbury enabled auto-merge (squash) October 1, 2024 16:45
@colesbury colesbury merged commit b482538 into python:main Oct 1, 2024
35 checks passed
@colesbury colesbury deleted the gh-124218-unique-id branch October 1, 2024 17:07
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.

3 participants