-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
gh-134584: Cleanups for refcount elimination #136104 and #135860 #142604
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
base: main
Are you sure you want to change the base?
Conversation
corona10
left a comment
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.
lgtm!
markshannon
left a comment
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.
Can you make a separate PRs for fixing the leak? I'd like to get that in ASAP.
For the larger changes:
- There is no need for
_POP_TOP_NOT_NULLas it still needs to check for immortal objects andNULLis immortal - The changes to the code generator need more explanation and maybe a new issue.
| assert(oparg == 1); | ||
| STAT_INC(CALL, hit); | ||
| PyObject *res_o = PySequence_Tuple(arg_o); | ||
| DEAD(null); |
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.
| DEAD(null); |
No need to declare null dead here as it will be handled by INPUTS_DEAD below.
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.
This is required so that ERROR_IF doesn't emit a useless close for it.
|
When you're done making the requested changes, leave the comment: |
I can't without a partial revert. The problem is that we don't allow live inputs at ERROR_IF. This PR simply changes the ERROR_IF behavior to close all live inputs. The rest of this PR to the cases generator is just moving stuff around if you take a closer look. I mainly had to expose the close_variable function as it was previously a nested one. |
|
Just for personal thought(correct me plz if I'm wrong) The root cause about this refleak is related with the wrong position about So the core point about this PR is the behavior change "raise an exception when here's live variable on TOS -> close all the live variable" So we can mark the stack |
|
@Zheaoli yes you're right |
This cleans up PRs #136104 and #135860. Fixing a refleak as well.
Mostly just moving code around.