GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||
GeezerVison is showing github.com — GH-119866: Don't clear `frame->stackpointer` on release builds by brandtbucher · Pull Request #131750 · python/cpython Conversation
|
| { | ||
| assert(frame->stackpointer != NULL); | ||
| _PyStackRef *sp = frame->stackpointer; | ||
| #ifndef NDEBUG |
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Maybe then update the comment
Having stackpointer == NULL ensures that invalid
values are not visible to the cycle GC.
Seems that this was done for the cycle GC - if this is no longer needed, just remove the comment?
Out of curiousity: is it safe in release builds to let the cycle GC see invalid values?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
We want to have "deferred" references on the stack, which means that the GC must be able to see all stack values, and only valid stack values.
Setting the stack pointer to NULL is only useful for our asserts, which are sprinkled throughout to make sure that we're spilling and restoring in the correct places. Basically, the GC should never see an invalid stack pointer. On debug builds, we make this easier to detect by setting invalid stack pointers to NULL and checking for this.
Either way, I'll update the comment.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.