Try the trivial patch below, the problems with globals get fixed...
However, enabling the refnanny will spot other reference count
problems, at least I get them in mpi4py ....
diff -r 3628c9268dfe Cython/Compiler/ModuleNode.py
--- a/Cython/Compiler/ModuleNode.py Sat Feb 21 22:34:25 2009 +0100
+++ b/Cython/Compiler/ModuleNode.py Sat Feb 21 20:32:14 2009 -0300
@@ -1651,11 +1651,9 @@
env.use_utility_code(Nodes.traceback_utility_code)
code.putln("%s = NULL;" % Naming.retval_cname)
code.put_label(code.return_label)
- # Disabled because of confusion with refcount of global
variables -- run ass2cglobal testcase to see
- #code.put_finish_refcount_context()
- code.putln("#if CYTHON_REFNANNY")
- code.putln("if (__pyx_refchk) {};")
- code.putln("#endif")
+
+ code.put_finish_refcount_context()
+
code.putln("#if PY_MAJOR_VERSION < 3")
code.putln("return;")
code.putln("#else")
@@ -1793,7 +1791,7 @@
for entry in env.var_entries:
if entry.visibility != 'extern':
if entry.type.is_pyobject and entry.used:
- code.put_init_var_to_py_none(entry)
+ code.put_init_var_to_py_none(entry, nanny=False)
def generate_c_function_export_code(self, env, code):
# Generate code to create PyCFunction wrappers for exported C
functions.
--
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev