projects
/
platform
/
upstream
/
python-cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1010f57
)
be a tiny bit smarter about when to GC_Track for the base type in tp_dealloc()
author
Stefan Behnel
<stefan_ml@behnel.de>
Fri, 9 Aug 2013 08:09:24 +0000
(10:09 +0200)
committer
Stefan Behnel
<stefan_ml@behnel.de>
Fri, 9 Aug 2013 08:09:24 +0000
(10:09 +0200)
Cython/Compiler/ModuleNode.py
patch
|
blob
|
history
diff --git
a/Cython/Compiler/ModuleNode.py
b/Cython/Compiler/ModuleNode.py
index
5806b1a
..
a5cc35f
100644
(file)
--- a/
Cython/Compiler/ModuleNode.py
+++ b/
Cython/Compiler/ModuleNode.py
@@
-1243,8
+1243,11
@@
class ModuleNode(Nodes.Node, Nodes.BlockNode):
if needs_gc:
# The base class deallocator probably expects this to be tracked,
# so undo the untracking above.
- code.putln("if (PyType_IS_GC(Py_TYPE(o)->tp_base))"
- " PyObject_GC_Track(o);")
+ if base_type.scope and base_type.scope.needs_gc():
+ code.putln("PyObject_GC_Track(o);")
+ else:
+ code.putln("if (PyType_IS_GC(Py_TYPE(o)->tp_base))"
+ " PyObject_GC_Track(o);")
tp_dealloc = TypeSlots.get_base_slot_function(scope, tp_slot)
if tp_dealloc is not None: