GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-45094: Add Py_ALWAYS_INLINE macro by vstinner · Pull Request #28141 · python/cpython

Conversation

@vstinner

@vstinner vstinner commented Sep 3, 2021 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Add Py_ALWAYS_INLINE macro to ask the compiler to always inline a
static inline function.

Use Py_ALWAYS_INLINE on static inline functions:

  • Py_DECREF(), Py_XDECREF()
  • Py_INCREF(), Py_XINCREF()
  • Py_IS_TYPE()
  • Py_NewRef(), Py_XNewRef()
  • Py_REFCNT()
  • Py_SET_REFCNT(), Py_SET_SIZE(), Py_SET_TYPE()

https://bugs.python.org/issue45094

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vstinner
bpo-45094: Add Py_ALWAYS_INLINE macro
3f211b6
Add Py_ALWAYS_INLINE macro to ask the compiler to always inline a
static inline function.

Use Py_ALWAYS_INLINE on static inline functions:

* Py_DECREF(), Py_XDECREF()
* Py_INCREF(), Py_XINCREF()
* Py_IS_TYPE()
* Py_NewRef(), Py_XNewRef()
* Py_REFCNT()
* Py_SET_REFCNT(), Py_SET_SIZE(), Py_SET_TYPE()
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Sep 3, 2021
@bedevere-bot bedevere-bot added the awaiting core review label Sep 3, 2021
@vstinner

vstinner commented Sep 3, 2021

Copy link
Copy Markdown
Member Author

cc @serhiy-storchaka @erlend-aasland @corona10 @pablogsal

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Fidget-Spinner
Fidget-Spinner reviewed Sep 3, 2021
View reviewed changes

@Fidget-Spinner Fidget-Spinner left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I just have some minor nits with wording and usage.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/c-api/intro.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Include/object.h Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Include/pyport.h Outdated
#endif

// Ask the compiler to always inline a static inline function. The compiler is
// free is ignored this "hint". This attribute can be used to avoid increasing

@Fidget-Spinner Fidget-Spinner Sep 3, 2021

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Suggested change
// free is ignored this "hint". This attribute can be used to avoid increasing
// free to ignore this "hint". This attribute can be used to avoid increasing

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Include/object.h Resolved

Uh oh!

There was an error while loading. Please reload this page.

erlend-aasland
erlend-aasland approved these changes Sep 3, 2021
View reviewed changes

@erlend-aasland erlend-aasland left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I have nothing to add after Ken's comments. LGTM :)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vstinner
Address review
c438765
@vstinner vstinner mentioned this pull request Sep 3, 2021
bpo-39573: Py_TYPE becomes a static inline function #28128
Merged
@vstinner

vstinner commented Sep 4, 2021

Copy link
Copy Markdown
Member Author

Sadly, it doesn't seem to solve PR #28128 problem.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner
vstinner marked this pull request as draft September 4, 2021 01:15
@vstinner

vstinner commented Sep 7, 2021

Copy link
Copy Markdown
Member Author

I rejected https://bugs.python.org/issue45094#msg401272

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner vstinner closed this Sep 7, 2021
@vstinner
vstinner deleted the always_inline branch September 7, 2021 13:45
@vstinner vstinner mentioned this pull request Sep 16, 2021
bpo-45116: Add the Py_ALWAYS_INLINE macro #28390
Merged
@eduardo-elizondo eduardo-elizondo mentioned this pull request Apr 10, 2023
gh-84436: Implement Immortal Objects #19474
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Fidget-Spinner Fidget-Spinner Fidget-Spinner left review comments
@erlend-aasland erlend-aasland erlend-aasland approved these changes
@ZeroIntensity ZeroIntensity Awaiting requested review from ZeroIntensity ZeroIntensity will be requested when the pull request is marked ready for review ZeroIntensity is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting core review

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@vstinner @erlend-aasland @Fidget-Spinner @the-knights-who-say-ni @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.