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 — bpo-1635741: Clean sysdict and builtins of interpreter by shihai1991 · Pull Request #21605 · python/cpython Conversation
|
|
The master benchmark: After this PR: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@vstinner Hi, victor, pls take a look after your vacation, thanks. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
🤖 New build scheduled with the buildbot fleet by @corona10 for commit 137967a 🤖 If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
thanks Dong-hee Na for your label ;) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| /* We don't clear sysdict and builtins until the end of this function. | ||
| Because clearing other attributes can execute arbitrary Python code | ||
| which reuqires sysdict and builtins. */ | ||
| PyDict_Clear(sysdict); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I don't see the point of adding two local variables, why not accessing directly the structure member?
| PyDict_Clear(sysdict); | |
| PyDict_Clear(interp->sysdict); |
Same remark on folowing line.
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.
interp->sysdict and interp->builtins will be cleared before this line. https://github.com/python/cpython/blob/master/Python/pystate.c#L297-L298
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.
Aha, I didn't notice. In this case, I suggest to move Py_CLEAR(interp->sysdict) and Py_CLEAR(interp->builtins) at the end. Something like:
PyDict_Clear(interp->sysdict);
PyDict_Clear(interp->builtins);
Py_CLEAR(interp->sysdict)
Py_CLEAR(interp->builtins);
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.
updated. And I delete the description info.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
What is this benchmark? Which code did you run? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Hm, This should not be called as benchmark. I compare the refleak of this PR with the refleak of master branch. I use debug mode to test it. Because the testcase in https://bugs.python.org/issue1635741#msg355187 use |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Since few people care about subinterpreters, I don't think that it's worth it to document this internal change in a NEWS entry: I added "skip news" label. |
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.
LGTM.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
thanks, victor. |
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.