-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
gh-139716: Use the same StackRef flagging scheme for immortals on FT build as on GIL build #141675
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?
gh-139716: Use the same StackRef flagging scheme for immortals on FT build as on GIL build #141675
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
PyStackReffunctions #139716