Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Closed
vstinner wants to merge 2 commits into
python:mainpython/cpython:mainfrom
vstinner:object_always_inlineCopy head branch name to clipboard
Closed

bpo-45116: Use Py_ALWAYS_INLINE in object.h#28427
vstinner wants to merge 2 commits into
python:mainpython/cpython:mainfrom
vstinner:object_always_inlineCopy head branch name to clipboard

Conversation

@vstinner

@vstinner vstinner commented Sep 17, 2021

Copy link
Copy Markdown
Member

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
Copy Markdown
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.