| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Sorry, something went wrong.
|
If this PR will be merged we can remove PyStackRef_FromPyObjectStealMortal at all. |
Sorry, something went wrong.
We can't rely on Py_DECREF to do the immortal check, as that is more expensive than simply checking a bit on a pointer. You have to do an atomic read of memory now. |
Sorry, something went wrong.
It seems that I'm not quite understand, when we will do additional atomic reads. |
Sorry, something went wrong.
|
Sorry I think I'm misunderstanding. This PR moves the immortal check from the stackref to the Py_DECREF right? |
Sorry, something went wrong.
Yes. If we steal stack reference from the immortal object then there will be no actual decrefing at Py_DECREF. |
Sorry, something went wrong.
Actually for immortal check, only ob_ref_local is read with relaxed order so it will get compiled to plain load. That will still be more instructions executed that checking a single bit though. |
Sorry, something went wrong.
|
Sorry, something went wrong.
|
I like the idea of merging the two implementations, but why choose the slower scheme, not the faster one? |
Sorry, something went wrong.
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This is another attempt to provide the same StackRef flagging scheme for all builds (GIL, FT, STACKREF_DEBUG).
Instead of adding _Py_IsImmortal check to PyStackRef_FromPyObjectSteal for FT builds as in #141675, we make no checks at all in this function.
As a result, immortal objects will be DECREF'ed with no effect at reference closing.