KEMBAR78
bpo-45116: Use Py_ALWAYS_INLINE in object.h by vstinner · Pull Request #28427 · python/cpython · GitHub
Skip to content

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