bpo-38205: replace get_small_int(ival) macro with a function version#16270
Conversation
Use Py_UNREACHABLE() macro in a safe way.
|
|
||
| /* If use inline functions here, may lose performance due to | ||
| unnecessary type casting. */ | ||
| #define IS_SMALL_INT(ival) (-NSMALLNEGINTS <= (ival) && (ival) < NSMALLPOSINTS) |
There was a problem hiding this comment.
Address STINNER Victor's advice:
Morever, if using a static inline function is causing issues, it would be nice to add a comment to explain why, so the issue will be avoided in the future.
https://bugs.python.org/issue37812#msg352670
vstinner
left a comment
There was a problem hiding this comment.
" bpo-38205: replace get_small_int(ival) macro with a function version #16270 "
Wait, https://bugs.python.org/issue38205 is about a macro which became a function and then was revert to a macro again... I don't understand why you make it a function... one more time.
Py_UNREACHABLE() should be fixed, not longobject.c.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
+1, close this PR. |
The current code is not consistent: |
Use Py_UNREACHABLE() macro in a safe way.
https://bugs.python.org/issue38205