Skip to content

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

Merged
rhettinger merged 1 commit intomasterfrom
unknown repository
Sep 6, 2019
Merged

bpo-38015: replace inline function is_small_int with a macro version#15710
rhettinger merged 1 commit intomasterfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

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