diff options
author | Fred Drake <fdrake@acm.org> | 2001-02-01 05:27:45 +0000 |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2001-02-01 05:27:45 +0000 |
commit | 41deb1efc2f969b58e49af669cc20d15ccdb04c6 (patch) | |
tree | 6478ef737151fb4e091594b78f611318a15d3a31 /Include/object.h | |
parent | 2de7471d69b950a64e52a950675d59d9f4071da1 (diff) | |
download | cpython-git-41deb1efc2f969b58e49af669cc20d15ccdb04c6.tar.gz |
PEP 205, Weak References -- initial checkin.
Diffstat (limited to 'Include/object.h')
-rw-r--r-- | Include/object.h | 8 |
1 files changed, 5 insertions, 3 deletions
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)) |