diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2013-07-27 07:52:50 +0200 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2013-07-27 07:52:50 +0200 |
commit | 81026937e1d5eb39284a0efc65e12e1c8cfc183c (patch) | |
tree | a3ba6eaa643b6f4cb3658623c076bd5c56add27a /Cython/Compiler/ModuleNode.py | |
parent | 5a76ba3e06aa675c2da24e1553ee87061fbf1f0d (diff) | |
download | cython-81026937e1d5eb39284a0efc65e12e1c8cfc183c.tar.gz |
avoid traversing/clearing exttype attributes with simple types during garbage collection
Diffstat (limited to 'Cython/Compiler/ModuleNode.py')
-rw-r--r-- | Cython/Compiler/ModuleNode.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index fc78e94c6..6f2a11488 100644 --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@ -1290,8 +1290,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): "static int %s(PyObject *o, visitproc v, void *a) {" % slot_func) - have_entries, (py_attrs, py_buffers, - memoryview_slices) = scope.get_refcounted_entries() + have_entries, (py_attrs, py_buffers, memoryview_slices) = ( + scope.get_refcounted_entries(include_gc_simple=False)) if base_type or py_attrs: code.putln("int e;") @@ -1354,13 +1354,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): if tp_slot.slot_code(scope) != slot_func: return # never used - py_attrs = [] - py_buffers = [] - for entry in scope.var_entries: - if entry.type.is_pyobject and entry.name != "__weakref__": - py_attrs.append(entry) - if entry.type == PyrexTypes.c_py_buffer_type: - py_buffers.append(entry) + have_entries, (py_attrs, py_buffers, memoryview_slices) = ( + scope.get_refcounted_entries(include_gc_simple=False)) if py_attrs or py_buffers or base_type: unused = '' |