-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gh-91912: Long object free list for medium value #91938
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
Conversation
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.
In the process of refactoring, what used to be PyObject_Free calls (matching the PyObject_Malloc calls used to allocate in the first place) became PyObject_Del calls (which pair with PyObject_New, which is not used here). I don't know whether the two happen to be compatible by coincidence, but even if they are, the calls should still pair with the other calls in the family; New with Del, Malloc with Free, while this patch now pairs Malloc with Del.
| else | ||
| #endif | ||
| { | ||
| Py_TYPE(op)->tp_free(op); |
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 feels like it should maybe be calling the type's tp_dealloc, not tp_free? Not going to swear to this, but it feels off to me (then again, calling their tp_dealloc could recurse)... Don't take this comment as gospel, I'm probably wrong here.
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.
The argument passed in should be long or a subclass of long, continued use of tp_dealloc has a high probability of leading to unlimited recursive calls.
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 has merge conflicts now.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
@iritkatriel Resolved conflicts with the main branch. |
|
Thanks for making the requested changes! @iritkatriel: please review the changes made to this pull request. |
#91912