-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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-123619: Add an unstable C API function for enabling deferred reference counting #123635
Conversation
Looks like my git email got screwed up... I'll fix that later. |
4d37dc8
to
6af0adf
Compare
I think we want this or something similar, but it needs to go through the C API working group first: https://github.com/capi-workgroup/decisions/ |
Sounds good. Though, there might be some technical issues here that I'm not thinking of. I proposed something similar using immortal objects rather than DRC, but it seems that we just can't ensure enough support for it to be worthwhile. |
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.
As @encukou wrote in capi-workgroup/decisions#42, this needs a test (in _testcapimodule.c
). I think the primary thing we can test is that the preconditions are enforced and that the return codes are correct.
Co-authored-by: Sam Gross <[email protected]>
Co-authored-by: Sam Gross <[email protected]>
I'll get to updating the rest of this sometime later today. |
I've added a test. At this point, is the |
…ython into api-deferred-rc
Co-authored-by: Petr Viktorin <[email protected]>
Co-authored-by: Petr Viktorin <[email protected]>
Co-authored-by: Petr Viktorin <[email protected]>
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.
LGTM.
@encukou, would you please take another look at this?
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.
This looks good, thank you!
… reference counting (pythonGH-123635) Co-authored-by: Sam Gross <[email protected]>
cc @Fidget-Spinner
📚 Documentation preview 📚: https://cpython-previews--123635.org.readthedocs.build/en/123635/c-api/object.html#c.PyUnstable_Object_SetDeferredRefcount