mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-128509: Add PyUnstable_IsImmortal
for finding immortal objects (GH-129182)
Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Petr Viktorin <encukou@gmail.com>
This commit is contained in:
parent
7ec17429d4
commit
3fb5f6eb9b
8 changed files with 51 additions and 5 deletions
|
@ -3155,3 +3155,12 @@ Py_REFCNT(PyObject *ob)
|
|||
{
|
||||
return _Py_REFCNT(ob);
|
||||
}
|
||||
|
||||
int
|
||||
PyUnstable_IsImmortal(PyObject *op)
|
||||
{
|
||||
/* Checking a reference count requires a thread state */
|
||||
_Py_AssertHoldsTstate();
|
||||
assert(op != NULL);
|
||||
return _Py_IsImmortal(op);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue