| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
I meant to open this PR in my fork until my issue has been reviewed/triaged and bug has been confirmed or rejected but I forgot to select the target repo for the PR... sorry about this. |
Sorry, something went wrong.
| Py_ssize_t size = Py_SIZE(self); | ||
| self->ob_item = NULL; | ||
| Py_SET_SIZE(self, 0); | ||
| self->allocated = 0; |
There was a problem hiding this comment.
list_clear_impl has extra code if Py_GIL_DISABLED - should we include it here?
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks for the comment, there is a discussion on the issue right now but I'll keep that in mind when time comes.
Sorry, something went wrong.
There was a problem hiding this comment.
Looks good!
Do you want to take this out of draft?
Sorry, something went wrong.
Oops, yes! |
Sorry, something went wrong.
…Clear` (pythonGH-145680) Setting the size to 0 turns the list contents into overallocated memory that the deallocator will free. Ownership is transferred to the new tuple so no refcount adjustment is needed.
| Back | FazBrowse Home | New Git URL |
Description
This is a fix for gh-145681.
Note I wanted to open this PR in my fork for the time being (until issue has been reviewed/triaged), but I accidentally opened it in the public CPython directly... Sorry about that.