Inada Naoki <[email protected]> added the comment:
I don't think calling APIs like _PyDict_CheckConsistency() is super useful.
Can the PR find bugs like issue33803 quickly?
I think calling tp_traverse is better.
static int
check_object(PyObject *obj, void *unused)
{
_PyObject_ASSERT(obj, Py_REFCNT(obj) > 0);
return 0;
}
static void
gc_check_object(PyGC_Head *gc)
{
PyObject *op = FROM_GC(gc);
_PyObject_ASSERT(op, Py_REFCNT(obj) > 0);
_PyObject_ASSERT(op, _PyObject_GC_IS_TRACKED(op));
Py_Type(op)->tp_traverse(op, (visitproc)check_object, NULL);
}
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue36389>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com