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-123619: Add an unstable C API function for enabling deferred reference counting #123635

Merged
merged 38 commits into from
Nov 13, 2024

Conversation

Copy link

cpython-cla-bot bot commented Sep 3, 2024

All commit authors signed the Contributor License Agreement.
CLA signed

@ZeroIntensity
Copy link
Member Author

Looks like my git email got screwed up... I'll fix that later.

@Fidget-Spinner
Copy link
Member

@colesbury

@ZeroIntensity ZeroIntensity marked this pull request as ready for review September 3, 2024 20:05
@colesbury
Copy link
Contributor

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/

@ZeroIntensity
Copy link
Member Author

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.

Copy link
Contributor

@colesbury colesbury left a 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.

Doc/c-api/object.rst Outdated Show resolved Hide resolved
Objects/object.c Outdated Show resolved Hide resolved
Objects/object.c Outdated Show resolved Hide resolved
Doc/c-api/object.rst Outdated Show resolved Hide resolved
Objects/object.c Outdated Show resolved Hide resolved
ZeroIntensity and others added 2 commits September 19, 2024 12:42
Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Sam Gross <colesbury@gmail.com>
@ZeroIntensity
Copy link
Member Author

I'll get to updating the rest of this sometime later today.

@ZeroIntensity
Copy link
Member Author

I've added a test. At this point, is the _Py_IsOwnedByCurrentThread check still needed?

@bedevere-bot bedevere-bot removed the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Oct 21, 2024
Doc/c-api/object.rst Outdated Show resolved Hide resolved
Doc/c-api/object.rst Outdated Show resolved Hide resolved
Doc/c-api/object.rst Show resolved Hide resolved
ZeroIntensity and others added 3 commits November 4, 2024 10:03
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Objects/object.c Outdated Show resolved Hide resolved
Copy link
Contributor

@colesbury colesbury left a 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?

Copy link
Member

@encukou encukou left a 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!

@encukou encukou enabled auto-merge (squash) November 13, 2024 12:56
@encukou encukou merged commit d00878b into python:main Nov 13, 2024
39 checks passed
@ZeroIntensity ZeroIntensity deleted the api-deferred-rc branch November 15, 2024 21:58
picnixz pushed a commit to picnixz/cpython that referenced this pull request Dec 8, 2024
… reference counting (pythonGH-123635)

Co-authored-by: Sam Gross <colesbury@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants