-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
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-45094: Add Py_ALWAYS_INLINE macro #28141
Conversation
Add Py_ALWAYS_INLINE macro to ask the compiler to always inline a static inline function. Use Py_ALWAYS_INLINE on static inline functions: * Py_DECREF(), Py_XDECREF() * Py_INCREF(), Py_XINCREF() * Py_IS_TYPE() * Py_NewRef(), Py_XNewRef() * Py_REFCNT() * Py_SET_REFCNT(), Py_SET_SIZE(), Py_SET_TYPE()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just have some minor nits with wording and usage.
Include/pyport.h
Outdated
@@ -557,6 +557,28 @@ extern "C" { | |||
#define _Py_HOT_FUNCTION | |||
#endif | |||
|
|||
// Ask the compiler to always inline a static inline function. The compiler is | |||
// free is ignored this "hint". This attribute can be used to avoid increasing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// free is ignored this "hint". This attribute can be used to avoid increasing | |
// free to ignore this "hint". This attribute can be used to avoid increasing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have nothing to add after Ken's comments. LGTM :)
Sadly, it doesn't seem to solve PR #28128 problem. |
I rejected https://bugs.python.org/issue45094#msg401272 |
Add Py_ALWAYS_INLINE macro to ask the compiler to always inline a
static inline function.
Use Py_ALWAYS_INLINE on static inline functions:
https://bugs.python.org/issue45094