summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
Diffstat (limited to 'Objects')
-rw-r--r--Objects/object.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/Objects/object.c b/Objects/object.c
index fd069f1..4987ff3 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -91,6 +91,21 @@ inc_count(PyTypeObject *tp)
}
#endif
+#ifdef Py_REF_DEBUG
+/* Log a fatal error; doesn't return. */
+void
+_Py_NegativeRefcount(const char *fname, int lineno, PyObject *op)
+{
+ char buf[300];
+
+ PyOS_snprintf(buf, sizeof(buf),
+ "%s:%i object at %p has negative ref count %i",
+ fname, lineno, op, op->ob_refcnt);
+ Py_FatalError(buf);
+}
+
+#endif /* Py_REF_DEBUG */
+
PyObject *
PyObject_Init(PyObject *op, PyTypeObject *tp)
{