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-40170: PyObject_GET_WEAKREFS_LISTPTR() becomes a function by vstinner · Pull Request #19377 · python/cpython

Conversation

@vstinner

@vstinner vstinner commented Apr 4, 2020 •
edited by bedevere-bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Convert PyObject_GET_WEAKREFS_LISTPTR() macro to a function to hide
implementation details: the macro accessed directly to
PyTypeObject.tp_weaklistoffset member.

https://bugs.python.org/issue40170

Sorry, something went wrong.

Uh oh!

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

All reactions
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Apr 4, 2020
@bedevere-bot bedevere-bot added the awaiting core review label Apr 4, 2020
@vstinner

vstinner commented Apr 5, 2020

Copy link
Copy Markdown
Member Author

PyObject_GET_WEAKREFS_LISTPTR() is used in the garbage collector.

If converting the macro into a regular function caused a performance overhead, we can add an internal macro / static inline function for Python internals.

cc @pablogsal @pitrou

All reactions

Sorry, something went wrong.

Uh oh!

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

pablogsal
pablogsal reviewed Apr 5, 2020
View reviewed changes
Comment thread Objects/object.c Resolved

Uh oh!

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

pablogsal
pablogsal approved these changes Apr 5, 2020
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels Apr 5, 2020
pablogsal
pablogsal reviewed Apr 5, 2020
View reviewed changes
Comment thread Misc/NEWS.d/next/C API/2020-04-05-00-10-45.bpo-40170.6nFYbY.rst Resolved

Uh oh!

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

@vstinner
bpo-40170: PyObject_GET_WEAKREFS_LISTPTR() becomes a function
f3d1998
Convert the PyObject_GET_WEAKREFS_LISTPTR() macro to a function to
hide implementation details: the macro accessed directly to the
PyTypeObject.tp_weaklistoffset member.

Add _PyObject_GET_WEAKREFS_LISTPTR() static inline function to the
internal C API.
@vstinner
vstinner merged commit 38aefc5 into python:master Apr 6, 2020
@bedevere-bot bedevere-bot removed the awaiting merge label Apr 6, 2020
@vstinner
vstinner deleted the get_weakrefs branch April 6, 2020 12:14
@vstinner

vstinner commented Apr 6, 2020

Copy link
Copy Markdown
Member Author

Thanks @pablogsal. I added a static inline function to the internal C API.

pablogsal reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@pablogsal pablogsal pablogsal approved these changes

Uh oh!

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

Assignees

No one assigned

Labels

None yet

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.

4 participants

@vstinner @pablogsal @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.