Mercurial > cpython-lru_cache-weakref
diff Include/object.h @ 62:fffd1286c882 legacy-trunk
Be more careful with negative reference counts.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Fri, 02 Nov 1990 17:51:56 +0000 |
| parents | fc6fcd7df4f7 |
| children | 36503736fdc2 |
line wrap: on
line diff
--- a/Include/object.h Fri Nov 02 17:51:17 1990 +0000 +++ b/Include/object.h Fri Nov 02 17:51:56 1990 +0000 @@ -56,7 +56,7 @@ #ifdef TRACE_REFS #define OB_HEAD \ struct _object *_ob_next, *_ob_prev; \ - unsigned int ob_refcnt; \ + int ob_refcnt; \ struct _typeobject *ob_type; #define OB_HEAD_INIT(type) 0, 0, 1, type, #else @@ -200,7 +200,7 @@ #endif #define INCREF(op) (ref_total++, (op)->ob_refcnt++) #define DECREF(op) \ - if (--ref_total, --(op)->ob_refcnt != 0) \ + if (--ref_total, --(op)->ob_refcnt > 0) \ ; \ else \ DELREF(op) @@ -208,7 +208,7 @@ #define NEWREF(op) ((op)->ob_refcnt = 1) #define INCREF(op) ((op)->ob_refcnt++) #define DECREF(op) \ - if (--(op)->ob_refcnt != 0) \ + if (--(op)->ob_refcnt > 0) \ ; \ else \ DELREF(op)
