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

bpo-45116: Use Py_ALWAYS_INLINE in object.h #28427

Closed
wants to merge 2 commits into from
Closed

bpo-45116: Use Py_ALWAYS_INLINE in object.h #28427

wants to merge 2 commits into from

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Sep 17, 2021

Use Py_ALWAYS_INLINE on all static inline functions of object.h:

  • Py_REFCNT(), Py_SET_REFCNT()
  • Py_TYPE(), Py_SET_TYPE()
  • Py_SIZE(), Py_SET_SIZE()
  • Py_IS_TYPE()
  • PyObject_TypeCheck()
  • Py_INCREF(), Py_XINCREF()
  • Py_DECREF(), Py_XDECREF()
  • Py_NewRef(), Py_XNewRef()
  • PyType_HasFeature()
  • PyType_Check(), PyType_CheckExact()

These static inline functions are short, simple and were macros in
older Python versions.

https://bugs.python.org/issue45116

Use Py_ALWAYS_INLINE on all static inline functions of object.h:

* Py_REFCNT(), Py_SET_REFCNT()
* Py_TYPE(), Py_SET_TYPE()
* Py_SIZE(), Py_SET_SIZE()
* Py_IS_TYPE()
* PyObject_TypeCheck()
* Py_INCREF(), Py_XINCREF()
* Py_DECREF(), Py_XDECREF()
* Py_NewRef(), Py_XNewRef()
* PyType_HasFeature()
* PyType_Check(), PyType_CheckExact()

These static inline functions are short, simple and were macros in
older Python versions.
Py_ALWAYS_INLINE must be specified *before* the return type
@vstinner
Copy link
Member Author

It seems like another approach is explored to solve https://bugs.python.org/issue45116

I abandon my draft PR.

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.

3 participants