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
5008e863
Commit
5008e863
authored
Oct 22, 2011
by
Mark Florisson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue errors for nogil buffer acquisition
parent
eee370b0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+8
-2
tests/errors/nogil_buffer_acquisition.pyx
tests/errors/nogil_buffer_acquisition.pyx
+10
-0
No files found.
Cython/Compiler/Nodes.py
View file @
5008e863
...
...
@@ -1807,8 +1807,14 @@ class CFuncDefNode(FuncDefNode):
formal_arg
.
type
=
type_arg
.
type
formal_arg
.
name
=
type_arg
.
name
formal_arg
.
cname
=
type_arg
.
cname
if
type_arg
.
type
.
is_buffer
and
'inline'
in
self
.
modifiers
:
warning
(
formal_arg
.
pos
,
"Buffer unpacking not optimized away."
,
1
)
if
type_arg
.
type
.
is_buffer
:
if
self
.
type
.
nogil
:
error
(
formal_arg
.
pos
,
"Buffer may not be acquired without the GIL. "
"Consider using memoryview slices instead."
)
elif
'inline'
in
self
.
modifiers
:
warning
(
formal_arg
.
pos
,
"Buffer unpacking not optimized away."
,
1
)
name
=
name_declarator
.
name
cname
=
name_declarator
.
cname
self
.
entry
=
env
.
declare_cfunction
(
...
...
tests/errors/nogil_buffer_acquisition.pyx
0 → 100644
View file @
5008e863
# mode: error
cimport
numpy
as
np
cdef
void
func
(
np
.
ndarray
[
np
.
double_t
,
ndim
=
1
]
myarray
)
nogil
:
pass
_ERRORS
=
u"""
5:15: Buffer may not be acquired without the GIL. Consider using memoryview slices instead.
"""
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