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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
b2a071a1
Commit
b2a071a1
authored
Aug 21, 2015
by
Robert Bradshaw
Committed by
Stefan Behnel
Aug 22, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Generate custom deallocation code when there are C++ members to destruct.
parent
fe08775d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
0 deletions
+5
-0
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+4
-0
Cython/Compiler/TypeSlots.py
Cython/Compiler/TypeSlots.py
+1
-0
No files found.
Cython/Compiler/Symtab.py
View file @
b2a071a1
...
...
@@ -1856,6 +1856,7 @@ class CClassScope(ClassScope):
# getset_table_cname string
# has_pyobject_attrs boolean Any PyObject attributes?
# has_memoryview_attrs boolean Any memory view attributes?
# has_cpp_class_attrs boolean Any (non-pointer) C++ attributes?
# has_cyclic_pyobject_attrs boolean Any PyObject attributes that may need GC?
# property_entries [Entry]
# defined boolean Defined in .pxd file
...
...
@@ -1866,6 +1867,7 @@ class CClassScope(ClassScope):
has_pyobject_attrs
=
False
has_memoryview_attrs
=
False
has_cpp_class_attrs
=
False
has_cyclic_pyobject_attrs
=
False
defined
=
False
implemented
=
False
...
...
@@ -1941,6 +1943,8 @@ class CClassScope(ClassScope):
self
.
var_entries
.
append
(
entry
)
if
type
.
is_memoryviewslice
:
self
.
has_memoryview_attrs
=
True
elif
type
.
is_cpp_class
:
self
.
has_cpp_class_attrs
=
True
elif
type
.
is_pyobject
and
name
!=
'__weakref__'
:
self
.
has_pyobject_attrs
=
True
if
(
not
type
.
is_builtin_type
...
...
Cython/Compiler/TypeSlots.py
View file @
b2a071a1
...
...
@@ -361,6 +361,7 @@ class ConstructorSlot(InternalMethodSlot):
and
scope
.
parent_type
.
base_type
and
not
scope
.
has_pyobject_attrs
and
not
scope
.
has_memoryview_attrs
and
not
scope
.
has_cpp_class_attrs
and
not
scope
.
lookup_here
(
self
.
method
)):
# if the type does not have object attributes, it can
# delegate GC methods to its parent - iff the parent
...
...
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