Skip to content

GH-94841: Fix usage of Py_ALWAYS_INLINE #104409

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
May 12, 2023

Conversation

brandtbucher
Copy link
Member

@brandtbucher brandtbucher commented May 11, 2023

This silences a compiler warning on non-debug builds:

Objects/obmalloc.c:886:1: warning: always_inline function might not be inlinable [-Wattributes]
  886 | arena_map_get(OMState *state, pymem_block *p, int create)
      | ^~~~~~~~~~~~~

The issue is that Py_ALWAYS_INLINE only works for static inline functions.

I'm also going to run the benchmarks on this out of an abundance of caution, since (at least in theory) this could force the compiler to make poor inlining decisions it currently avoids.

Copy link
Member

@corona10 corona10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@brandtbucher
Copy link
Member Author

No impact.

@brandtbucher brandtbucher merged commit a10b026 into python:main May 12, 2023
@miss-islington
Copy link
Contributor

Thanks @brandtbucher for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry, @brandtbucher, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker a10b026f0fdceac42c4b928917894d77da996555 3.11

brandtbucher added a commit to brandtbucher/cpython that referenced this pull request May 12, 2023
(cherry picked from commit a10b026)

Co-authored-by: Brandt Bucher <[email protected]>
@brandtbucher brandtbucher removed the needs backport to 3.11 only security fixes label May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants