[pypy-svn] r73280 - pypy/branch/cpython-extension/pypy/module/cpyext/include

fijal at codespeak.net fijal at codespeak.net
Fri Apr 2 05:16:18 CEST 2010


Author: fijal
Date: Fri Apr  2 05:16:13 2010
New Revision: 73280

Modified:
   pypy/branch/cpython-extension/pypy/module/cpyext/include/object.h
Log:
Define Py_X[INC|DEC]REF


Modified: pypy/branch/cpython-extension/pypy/module/cpyext/include/object.h
==============================================================================
--- pypy/branch/cpython-extension/pypy/module/cpyext/include/object.h	(original)
+++ pypy/branch/cpython-extension/pypy/module/cpyext/include/object.h	Fri Apr  2 05:16:13 2010
@@ -39,6 +39,8 @@
 
 #define Py_INCREF(ob)		(Py_IncRef(ob))
 #define Py_DECREF(ob)		(Py_DecRef(ob))
+#define Py_XINCREF(op) do { if ((op) == NULL) ; else Py_INCREF(op); } while (0)
+#define Py_XDECREF(op) do { if ((op) == NULL) ; else Py_DECREF(op); } while (0)
 
 #define Py_REFCNT(ob)		(((PyObject*)(ob))->ob_refcnt)
 #define Py_TYPE(ob)		(((PyObject*)(ob))->ob_type)



More information about the Pypy-commit mailing list