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
Xavier Thompson
cython
Commits
28f869fd
Commit
28f869fd
authored
May 27, 2017
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't require the GIL for the empty constructor.
parent
601f25ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+2
-1
tests/run/cpp_classes_def.pyx
tests/run/cpp_classes_def.pyx
+8
-0
No files found.
Cython/Compiler/ExprNodes.py
View file @
28f869fd
...
...
@@ -1692,7 +1692,8 @@ class NewExprNode(AtomicExprNode):
self
.
cpp_check
(
env
)
constructor
=
type
.
scope
.
lookup
(
u'<init>'
)
if
constructor
is
None
:
func_type
=
PyrexTypes
.
CFuncType
(
type
,
[],
exception_check
=
'+'
)
func_type
=
PyrexTypes
.
CFuncType
(
type
,
[],
exception_check
=
'+'
,
nogil
=
True
)
type
.
scope
.
declare_cfunction
(
u'<init>'
,
func_type
,
self
.
pos
)
constructor
=
type
.
scope
.
lookup
(
u'<init>'
)
self
.
class_type
=
type
...
...
tests/run/cpp_classes_def.pyx
View file @
28f869fd
...
...
@@ -143,3 +143,11 @@ def test_templates(long value):
assert
base
.
get_value
()
==
base
.
value
==
2
*
value
,
base
.
value
del
base
cdef
cppclass
Simple
:
pass
def
test_default_init_no_gil
():
with
nogil
:
s
=
new
Simple
()
del
s
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