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-38015: replace inline function is_small_int with a macro version#15710

Merged
rhettinger merged 1 commit into
masterpython/cpython:masterfrom
unknown repositoryCopy head branch name to clipboard
Sep 6, 2019
Merged

bpo-38015: replace inline function is_small_int with a macro version#15710
rhettinger merged 1 commit into
masterpython/cpython:masterfrom
unknown repositoryCopy head branch name to clipboard

Conversation

@ghost

@ghost ghost commented Sep 6, 2019

Copy link
Copy Markdown

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

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