[pypy-svn] r72462 - in pypy/trunk/pypy/module/cpyext: . test

jandem at codespeak.net jandem at codespeak.net
Sat Mar 20 18:28:53 CET 2010


Author: jandem
Date: Sat Mar 20 18:28:52 2010
New Revision: 72462

Modified:
   pypy/trunk/pypy/module/cpyext/macros.py
   pypy/trunk/pypy/module/cpyext/test/test_floatobject.py
Log:
Fix Py_DECREF, lltype.free accepts two arguments


Modified: pypy/trunk/pypy/module/cpyext/macros.py
==============================================================================
--- pypy/trunk/pypy/module/cpyext/macros.py	(original)
+++ pypy/trunk/pypy/module/cpyext/macros.py	Sat Mar 20 18:28:52 2010
@@ -15,7 +15,7 @@
         ptr = ctypes.addressof(obj._obj._storage)
         del state.py_objects_r2w[ptr]
         # XXX this will likely be somewhere else when we have grown a type object
-        lltype.free(obj)
+        lltype.free(obj, flavor='raw')
     else:
         assert obj.c_refcnt > 0
     return

Modified: pypy/trunk/pypy/module/cpyext/test/test_floatobject.py
==============================================================================
--- pypy/trunk/pypy/module/cpyext/test/test_floatobject.py	(original)
+++ pypy/trunk/pypy/module/cpyext/test/test_floatobject.py	Sat Mar 20 18:28:52 2010
@@ -19,6 +19,7 @@
         {
             PyObject* obj = PyFloat_FromDouble(23.45);
             double d = PyFloat_AsDouble(obj);
+            Py_DECREF(obj);
             return PyFloat_FromDouble(d);
         }
         static PyMethodDef methods[] = {



More information about the Pypy-commit mailing list