Skip to content

bpo-38015: replace inline function is_small_int with a macro version #15710

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

Merged
merged 1 commit into from Sep 6, 2019
Merged

bpo-38015: replace inline function is_small_int with a macro version #15710

merged 1 commit into from Sep 6, 2019

Conversation

ghost
Copy link

@ghost ghost commented Sep 6, 2019

There is an unnecessary type casting (to long long), may slightly reduce performance:

static inline int
is_small_int(long long ival)
{
    return -NSMALLNEGINTS <= ival && ival < NSMALLPOSINTS;
}

https://bugs.python.org/issue38015

There is an unnecessary type casting (to long long), may slightly reduce performance:

static inline int
is_small_int(long long ival)
{
    return -NSMALLNEGINTS <= ival && ival < NSMALLPOSINTS;
}
@rhettinger rhettinger merged commit 6b51998 into python:master Sep 6, 2019
@ghost ghost deleted the small_int_macro branch September 6, 2019 06:02
lisroach pushed a commit to lisroach/cpython that referenced this pull request Sep 10, 2019
@vstinner
Copy link
Member

This change introduced a regression: https://bugs.python.org/issue38205 Python no longer builds without small integer singletons :-(

DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
websurfer5 pushed a commit to websurfer5/cpython that referenced this pull request Jul 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants