GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-124074: Add _Py_NewImmortalRef() function by vstinner · Pull Request #124076 · python/cpython Conversation
|
|
cc @encukou |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| // Similar to Py_NewRef() but for immortal objects. | ||
| // obj must be immortal. | ||
| static inline PyObject* _Py_NewImmortalRef(PyObject *obj) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
PEP 7:
| // Similar to Py_NewRef() but for immortal objects. | |
| // obj must be immortal. | |
| static inline PyObject* _Py_NewImmortalRef(PyObject *obj) | |
| // Similar to Py_NewRef() but for immortal objects. | |
| // obj must be immortal. | |
| static inline PyObject * | |
| _Py_NewImmortalRef(PyObject *obj) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
If you ask me: I don't think this is useful without
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Do you mean a tool which would fail if |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
For clarification: would |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
It works on any immortal object: https://docs.python.org/dev/glossary.html#term-immortal |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
AFAIK, it would only need the existing |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
It's more complicated than that since Python/ceval.c now converts immortal objects to "stack ref" objects and it doesn't call DECREF on them on purpose. Maybe it's a lost battle and we should give up on doing |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Yeah, it would need to start doing that DECREF, in debug builds. Otherwise, |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I prefer to abandon this function at this point. I failed to update Py_INCREF(), Py_DECREF() and _Py_NewImmortalRef() to keep a consistent "total ref count" using |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.