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
ff2db658
Commit
ff2db658
authored
Jun 01, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adapt dealloc function for cypclass-wrapping c classes
parent
19193e74
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+10
-0
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+2
-0
No files found.
Cython/Compiler/ModuleNode.py
View file @
ff2db658
...
@@ -1683,6 +1683,16 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
...
@@ -1683,6 +1683,16 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
.
putln
(
code
.
putln
(
"static void %s(PyObject *o) {"
%
slot_func_cname
)
"static void %s(PyObject *o) {"
%
slot_func_cname
)
# for cyp wrappers, just decrement the atomic counter of the underlying type
is_cyp_wrapper
=
scope
.
parent_type
.
is_cyp_wrapper
if
is_cyp_wrapper
:
self
.
generate_self_cast
(
scope
,
code
)
code
.
putln
(
"Cy_DECREF(p->%s);"
%
CypclassWrapper
.
underlying_name
)
code
.
putln
(
"}"
)
if
cdealloc_func_entry
is
None
:
code
.
putln
(
"#endif"
)
return
is_final_type
=
scope
.
parent_type
.
is_final_type
is_final_type
=
scope
.
parent_type
.
is_final_type
needs_gc
=
scope
.
needs_gc
()
needs_gc
=
scope
.
needs_gc
()
needs_trashcan
=
scope
.
needs_trashcan
()
needs_trashcan
=
scope
.
needs_trashcan
()
...
...
Cython/Compiler/Nodes.py
View file @
ff2db658
...
@@ -5566,6 +5566,8 @@ class CypclassWrapperDefNode(CClassDefNode):
...
@@ -5566,6 +5566,8 @@ class CypclassWrapperDefNode(CClassDefNode):
def
analyse_declarations
(
self
,
env
):
def
analyse_declarations
(
self
,
env
):
# > analyse declarations before inserting methods
# > analyse declarations before inserting methods
super
(
CypclassWrapperDefNode
,
self
).
analyse_declarations
(
env
)
super
(
CypclassWrapperDefNode
,
self
).
analyse_declarations
(
env
)
# > mark the wrapper type as such
self
.
entry
.
type
.
is_cyp_wrapper
=
1
# > associate the wrapper type to the wrapped type
# > associate the wrapper type to the wrapped type
self
.
wrapped_cypclass
.
entry
.
type
.
wrapper_type
=
self
.
entry
.
type
self
.
wrapped_cypclass
.
entry
.
type
.
wrapper_type
=
self
.
entry
.
type
# > insert and analyse each method wrapper
# > insert and analyse each method wrapper
...
...
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