Skip to content

gh-123619: Add an unstable C API function for enabling deferred reference counting#123635

Merged
encukou merged 38 commits into
python:mainfrom
ZeroIntensity:api-deferred-rc
Nov 13, 2024
Merged

gh-123619: Add an unstable C API function for enabling deferred reference counting#123635
encukou merged 38 commits into
python:mainfrom
ZeroIntensity:api-deferred-rc

Conversation

@ZeroIntensity

@ZeroIntensity ZeroIntensity commented Sep 3, 2024

Copy link
Copy Markdown
Member

@ghost

ghost commented Sep 3, 2024

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.
CLA signed

@ZeroIntensity

Copy link
Copy Markdown
Member Author

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

@Fidget-Spinner

Copy link
Copy Markdown
Member

@colesbury

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

Copy link
Copy Markdown
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
Copy Markdown
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.

@colesbury colesbury left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread Doc/c-api/object.rst Outdated
Comment thread Objects/object.c Outdated
Comment thread Objects/object.c Outdated
Comment thread Doc/c-api/object.rst Outdated
Comment thread Objects/object.c Outdated
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
Copy Markdown
Member Author

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

@ZeroIntensity

Copy link
Copy Markdown
Member Author

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

Comment thread Doc/c-api/object.rst Outdated
Comment thread Doc/c-api/object.rst Outdated
Comment thread Doc/c-api/object.rst
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>
Comment thread Objects/object.c Outdated

@colesbury colesbury left a comment

Copy link
Copy Markdown
Contributor

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?

@encukou encukou left a comment

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.

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
@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>
ebonnal pushed a commit to ebonnal/cpython that referenced this pull request Jan 12, 2025
… 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