Uh oh!
There was an error while loading. Please reload this page.
gh-111506: Implement Py_SET_REFCNT() as opaque function in limited C API - #111508
Conversation
…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.
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