gh-139716: Use the same StackRef flagging scheme for immortals on FT build as on GIL build#141675
gh-139716: Use the same StackRef flagging scheme for immortals on FT build as on GIL build#141675efimov-mikhail wants to merge 4 commits intopython:mainfrom
Conversation
|
I propose to merge #139717 first and then merge this PR with a proper test change. |
|
We'll need to benchmark this, as it may cause a slowdown with the extra check. |
Include/internal/pycore_stackref.h
Outdated
| assert(((uintptr_t)obj & Py_TAG_BITS) == 0); | ||
| assert(obj != NULL); | ||
| if (_PyObject_HasDeferredRefcount(obj)) { | ||
| if (_PyObject_HasDeferredRefcount(obj) || _Py_IsImmortal(obj)) { |
There was a problem hiding this comment.
I think we should just set immortal objects as having deferred refcount too in _Py_SetImmortal, that way this iwll just be a single check. Though it's been some time since I worked on FT so I don't know the implications of that (I think there should be none?)
I'll run a benchmark eventually, before we merge. |
|
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 |
|
Ok, I've got it. |
PyStackReffunctions #139716