From 41deb1efc2f969b58e49af669cc20d15ccdb04c6 Mon Sep 17 00:00:00 2001 From: Fred Drake Date: Thu, 1 Feb 2001 05:27:45 +0000 Subject: PEP 205, Weak References -- initial checkin. --- Include/object.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Include/object.h') diff --git a/Include/object.h b/Include/object.h index de6750550a..1eaa900235 100644 --- a/Include/object.h +++ b/Include/object.h @@ -246,8 +246,8 @@ typedef struct _typeobject { /* rich comparisons */ richcmpfunc tp_richcompare; - /* More spares */ - long tp_xxx8; + /* weak reference enabler */ + long tp_weaklistoffset; #ifdef COUNT_ALLOCS /* these must be last */ @@ -284,6 +284,8 @@ extern DL_IMPORT(int) PyCallable_Check(PyObject *); extern DL_IMPORT(int) PyNumber_Coerce(PyObject **, PyObject **); extern DL_IMPORT(int) PyNumber_CoerceEx(PyObject **, PyObject **); +extern DL_IMPORT(int) (*PyObject_ClearWeakRefs)(PyObject *); + /* Helpers for printing recursive container types */ extern DL_IMPORT(int) Py_ReprEnter(PyObject *); extern DL_IMPORT(void) Py_ReprLeave(PyObject *); @@ -418,7 +420,7 @@ extern DL_IMPORT(long) _Py_RefTotal; #define Py_INCREF(op) (_Py_RefTotal++, (op)->ob_refcnt++) #define Py_DECREF(op) \ - if (--_Py_RefTotal, --(op)->ob_refcnt != 0) \ + if (--_Py_RefTotal, (--((op)->ob_refcnt) != 0)) \ ; \ else \ _Py_Dealloc((PyObject *)(op)) -- cgit v1.2.1