Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
1f35c14d
Commit
1f35c14d
authored
Jan 13, 2008
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
divert tp_clear()/tp_traverse() to parent type if type has no object attributes
parent
aa0ec1fc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
Cython/Compiler/TypeSlots.py
Cython/Compiler/TypeSlots.py
+9
-3
No files found.
Cython/Compiler/TypeSlots.py
View file @
1f35c14d
...
...
@@ -220,10 +220,16 @@ class GCDependentSlot(InternalMethodSlot):
InternalMethodSlot
.
__init__
(
self
,
slot_name
)
def
slot_code
(
self
,
scope
):
if
scope
.
needs_gc
():
return
InternalMethodSlot
.
slot_code
(
self
,
scope
)
else
:
if
not
scope
.
needs_gc
():
return
"0"
if
not
scope
.
has_pyobject_attrs
:
# if the type does not have object attributes, it can
# delegate GC methods to its parent - iff the parent
# functions are defined in the same module
parent_type_scope
=
scope
.
parent_type
.
base_type
.
scope
if
scope
.
parent_scope
is
parent_type_scope
.
parent_scope
:
return
self
.
slot_code
(
parent_type_scope
)
return
InternalMethodSlot
.
slot_code
(
self
,
scope
)
class
SyntheticSlot
(
InternalMethodSlot
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment