Author: Amaury Forgeot d'Arc <[email protected]>
Branch: 
Changeset: r55947:03a653bbde1d
Date: 2012-07-06 22:52 +0200
http://bitbucket.org/pypy/pypy/changeset/03a653bbde1d/

Log:    Py_INCREF macros should use the fast version by default.i Thanks
        Stefan for finding the typo.

diff --git a/pypy/module/cpyext/include/object.h 
b/pypy/module/cpyext/include/object.h
--- a/pypy/module/cpyext/include/object.h
+++ b/pypy/module/cpyext/include/object.h
@@ -38,12 +38,14 @@
        PyObject_VAR_HEAD
 } PyVarObject;
 
-#ifndef PYPY_DEBUG_REFCOUNT
+#ifdef PYPY_DEBUG_REFCOUNT
+/* Slow version, but useful for debugging */
 #define Py_INCREF(ob)   (Py_IncRef((PyObject *)ob))
 #define Py_DECREF(ob)   (Py_DecRef((PyObject *)ob))
 #define Py_XINCREF(ob)  (Py_IncRef((PyObject *)ob))
 #define Py_XDECREF(ob)  (Py_DecRef((PyObject *)ob))
 #else
+/* Fast version */
 #define Py_INCREF(ob)   (((PyObject *)ob)->ob_refcnt++)
 #define Py_DECREF(ob)  ((((PyObject *)ob)->ob_refcnt > 1) ? \
                        ((PyObject *)ob)->ob_refcnt-- : (Py_DecRef((PyObject 
*)ob)))
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to