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
a6987893
Commit
a6987893
authored
Dec 28, 2018
by
Boxiang Sun
Committed by
gsamain
Jul 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial attempt to add cdef magic method to nogil extension
parent
0ee0b6eb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
1 deletion
+8
-1
Cython/Compiler/Code.py
Cython/Compiler/Code.py
+2
-0
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+4
-0
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+2
-1
No files found.
Cython/Compiler/Code.py
View file @
a6987893
...
...
@@ -1974,6 +1974,8 @@ class CCodeWriter(object):
elif
type
.
is_memoryviewslice
:
from
.
import
MemoryView
self
.
putln
(
"%s = %s;"
%
(
decl
,
MemoryView
.
memslice_entry_init
))
elif
type
.
is_struct
and
type
.
is_extension_type
and
type
.
nogil
:
self
.
putln
(
"%s;"
%
decl
)
else
:
self
.
putln
(
"%s%s;"
%
(
static
and
"static "
or
""
,
decl
))
...
...
Cython/Compiler/Nodes.py
View file @
a6987893
...
...
@@ -5974,6 +5974,8 @@ class DelStatNode(StatNode):
error
(
arg
.
pos
,
"Deletion of global C variable"
)
elif
arg
.
type
.
is_ptr
and
arg
.
type
.
base_type
.
is_cpp_class
:
self
.
cpp_check
(
env
)
elif
arg
.
type
.
is_struct_or_union
and
arg
.
type
.
nogil
:
pass
# del nogil extension
elif
arg
.
type
.
is_cpp_class
:
error
(
arg
.
pos
,
"Deletion of non-heap C++ object"
)
elif
arg
.
is_subscript
and
arg
.
base
.
type
is
Builtin
.
bytearray_type
:
...
...
@@ -6002,6 +6004,8 @@ class DelStatNode(StatNode):
arg
.
generate_evaluation_code
(
code
)
code
.
putln
(
"delete %s;"
%
arg
.
result
())
arg
.
generate_disposal_code
(
code
)
elif
arg
.
type
.
is_struct_or_union
and
hasattr
(
arg
.
type
,
"nogil"
)
and
arg
.
type
.
nogil
:
code
.
putln
(
"free(&%s);"
%
arg
.
result
())
# else error reported earlier
def
annotate
(
self
,
code
):
...
...
Cython/Compiler/Symtab.py
View file @
a6987893
...
...
@@ -2256,7 +2256,8 @@ class CClassScope(ClassScope):
cname
=
None
,
visibility
=
'private'
,
api
=
0
,
in_pxd
=
0
,
defining
=
0
,
modifiers
=
(),
utility_code
=
None
,
overridable
=
False
):
if
get_special_method_signature
(
name
)
and
not
self
.
parent_type
.
is_builtin_type
:
error
(
pos
,
"Special methods must be declared with 'def', not 'cdef'"
)
if
not
(
hasattr
(
self
.
parent_type
,
"nogil"
)
and
self
.
parent_type
.
nogil
and
self
.
parent_type
.
is_struct_or_union
):
error
(
pos
,
"Special methods must be declared with 'def', not 'cdef'"
)
args
=
type
.
args
if
not
type
.
is_static_method
:
if
not
args
:
...
...
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