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
Gwenaël Samain
cython
Commits
ce881ade
Commit
ce881ade
authored
Apr 29, 2019
by
gsamain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CythonExtensionType type test unification (DictNode memory init code)
parent
0ae1dd51
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+4
-1
No files found.
Cython/Compiler/ExprNodes.py
View file @
ce881ade
...
@@ -8769,9 +8769,12 @@ class DictNode(ExprNode):
...
@@ -8769,9 +8769,12 @@ class DictNode(ExprNode):
# pairs are evaluated and used one at a time.
# pairs are evaluated and used one at a time.
code
.
mark_pos
(
self
.
pos
)
code
.
mark_pos
(
self
.
pos
)
self
.
allocate_temp_result
(
code
)
self
.
allocate_temp_result
(
code
)
if
hasattr
(
self
.
type
,
'nogil'
)
and
self
.
type
.
nogil
:
if
self
.
type
.
is_extension_type
and
not
self
.
type
.
is_pyobject
:
# CythonExtensionTypes are allocated "by-hand"
code
.
putln
(
"%s = (struct %s *)malloc(sizeof(struct %s));"
%
(
self
.
result
(),
self
.
type
.
objstruct_cname
,
self
.
type
.
objstruct_cname
))
code
.
putln
(
"%s = (struct %s *)malloc(sizeof(struct %s));"
%
(
self
.
result
(),
self
.
type
.
objstruct_cname
,
self
.
type
.
objstruct_cname
))
# And their method table must be properly set (self.type.vtabptr_cname is set at runtime)
code
.
putln
(
"%s->%s = %s;"
%
(
self
.
result
(),
self
.
type
.
vtabslot_cname
,
self
.
type
.
vtabptr_cname
))
code
.
putln
(
"%s->%s = %s;"
%
(
self
.
result
(),
self
.
type
.
vtabslot_cname
,
self
.
type
.
vtabptr_cname
))
# Finally set the reference counting
code
.
putln
(
"_CyObject_CAST(%s)->ob_refcnt = 1;"
%
self
.
result
())
code
.
putln
(
"_CyObject_CAST(%s)->ob_refcnt = 1;"
%
self
.
result
())
is_dict
=
self
.
type
.
is_pyobject
is_dict
=
self
.
type
.
is_pyobject
...
...
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