Skip to content

Conversation

@colesbury
Copy link
Contributor

@colesburycolesbury commented Aug 12, 2024

  • The free-threaded GC now visits interpreter stacks to keep objects that use deferred reference counting alive.

  • Interpreter frames are zero initialized in the free-threaded GC so that the GC doesn't see garbage data. This is a temporary measure until stack spilling around escaping calls is implemented.

* The free-threaded GC now visits interpreter stacks to keep objects that use deferred reference counting alive. * Interpreter frames are zero initialized in the free-threaded GC so that the GC doesn't see garbage data. This is a temporary measure until stack spilling around escaping calls is implemented. Co-authored-by: Ken Jin <kenjin@python.org>
@colesbury
Copy link
ContributorAuthor

@colesburycolesbury marked this pull request as ready for review August 12, 2024 20:42
Copy link
Contributor

@DinoVDinoV left a comment

Choose a reason for hiding this comment

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

LGTM!

int
_PyGC_VisitFrameStack(_PyInterpreterFrame*frame, visitprocvisit, void*arg)
{
_PyStackRef*ref=frame->localsplus;
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe use _PyFrame_GetLocalsArray like the GIL version just to be consistent?

@colesburycolesbury added the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Aug 13, 2024
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @colesbury for commit 5b9176b 🤖

If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Aug 13, 2024
@colesburycolesbury enabled auto-merge (squash) August 15, 2024 16:08
@colesburycolesbury merged commit e001027 into python:mainAug 15, 2024
@colesburycolesbury deleted the gh-117139-deferred-gc branch August 15, 2024 16:10
blhsing pushed a commit to blhsing/cpython that referenced this pull request Aug 22, 2024
…ython#122956) The free-threaded GC now visits interpreter stacks to keep objects that use deferred reference counting alive. Interpreter frames are zero initialized in the free-threaded GC so that the GC doesn't see garbage data. This is a temporary measure until stack spilling around escaping calls is implemented. Co-authored-by: Ken Jin <kenjin@python.org>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@colesbury@bedevere-bot@DinoV@kumaraditya303