Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
gh-111506: Implement Py_SET_REFCNT() as opaque function in limited C API#111508
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
vstinner commented Oct 30, 2023 • edited by bedevere-app bot
Loading Uh oh!
There was an error while loading. Please reload this page.
edited by bedevere-app bot
Uh oh!
There was an error while loading. Please reload this page.
…ted C API In the limited C API version 3.13, Py_SET_REFCNT() function is now implemented as an opaque function call. Add _Py_SetRefcnt() to the stable ABI.
encukou commented Oct 31, 2023
Why is this particular function necessary?
|
vstinner commented Oct 31, 2023
It's needed to be able to remove non-portable assembly code from The code was just change for free threading. This change follows Py_INCREF/DECREF which already use an opaque function call in limited C API version 3.12. |
vstinner commented Oct 31, 2023
I also have concerns about that. But this change is a practical change to make the situation less bad. I plan to work on a whole PEP to disallow accessing directly PyObject.ob_refcnt and convert more functions to opaque function calls in the limited C API, as Sam describes in the issue. |
vstinner commented Nov 3, 2023
@colesbury@serhiy-storchaka@erlend-aasland: Would you mind to review this change? |
erlend-aasland commented Nov 3, 2023
I'll leave this to @colesbury. |
colesbury left a comment
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
I think this only improves our compatibility story going forward. We have already committed to this functionality as part of the API and ABI. Using an opaque function instead of an inline function does not change this.
encukou commented Nov 3, 2023
+1 API-wise -- keeping it |
vstinner commented Nov 3, 2023
Merged, thanks for reviews. |
bedevere-bot commented Nov 3, 2023
|
…ted C API (python#111508) In the limited C API version 3.13, Py_SET_REFCNT() function is now implemented as an opaque function call. Add _Py_SetRefcnt() to the stable ABI.
…ted C API (python#111508) In the limited C API version 3.13, Py_SET_REFCNT() function is now implemented as an opaque function call. Add _Py_SetRefcnt() to the stable ABI.
In the limited C API version 3.13, Py_SET_REFCNT() function is now implemented as an opaque function call.
Add _Py_SetRefcnt() to the stable ABI.
--disable-gilbuilds are not compatible with the limited API #111506