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

[3.12] gh-102304: Fix Py_INCREF() stable ABI in debug mode (#104763) #105352

Merged
merged 1 commit into from
Jun 6, 2023

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Jun 6, 2023

When Python is built in debug mode (if the Py_REF_DEBUG macro is defined), the Py_INCREF() and Py_DECREF() function are now always implemented as opaque functions to avoid leaking implementation details like the "_Py_RefTotal" variable or the
_Py_DecRefTotal_DO_NOT_USE_THIS() function.

  • Remove _Py_IncRefTotal_DO_NOT_USE_THIS() and _Py_DecRefTotal_DO_NOT_USE_THIS() from the stable ABI.
  • Remove _Py_NegativeRefcount() from limited C API.

(cherry picked from commit 92022d8)


📚 Documentation preview 📚: https://cpython-previews--105352.org.readthedocs.build/

@vstinner
Copy link
Member Author

vstinner commented Jun 6, 2023

Oh. If this change is merged, Doc/whatsnew/3.13.rst must be updated in the main branch: the build change happens in Python 3.12, not 3.13.

@vstinner
Copy link
Member Author

vstinner commented Jun 6, 2023

PR #105347 doc change should be merged first.

)

When Python is built in debug mode (if the Py_REF_DEBUG macro is
defined), the Py_INCREF() and Py_DECREF() function are now always
implemented as opaque functions to avoid leaking implementation
details like the "_Py_RefTotal" variable or the
_Py_DecRefTotal_DO_NOT_USE_THIS() function.

* Remove _Py_IncRefTotal_DO_NOT_USE_THIS() and
  _Py_DecRefTotal_DO_NOT_USE_THIS() from the stable ABI.
* Remove _Py_NegativeRefcount() from limited C API.

(cherry picked from commit 92022d8)
@vstinner vstinner merged commit 2bbb557 into python:3.12 Jun 6, 2023
@vstinner vstinner deleted the incref_debug312 branch June 6, 2023 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants