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
8a6cee25
Commit
8a6cee25
authored
Jun 18, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix builtin cypclass refcounting macros being called with std::move
parent
24194ab3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
Cython/Compiler/Builtin.py
Cython/Compiler/Builtin.py
+9
-2
No files found.
Cython/Compiler/Builtin.py
View file @
8a6cee25
...
...
@@ -652,8 +652,15 @@ def init_builtin_structs():
name
,
"struct"
,
scope
,
1
,
None
,
cname
=
cname
)
def
inject_cypclass_refcount_macros
():
macro_type
=
PyrexTypes
.
CFuncType
(
PyrexTypes
.
c_void_type
,
[
PyrexTypes
.
CFuncTypeArg
(
"obj"
,
PyrexTypes
.
cy_object_type
,
None
)],
nogil
=
1
)
for
macro
in
[
"Cy_INCREF"
,
"Cy_DECREF"
,
"Cy_XDECREF"
]:
reference_to_cy_object_type
=
PyrexTypes
.
CReferenceType
(
PyrexTypes
.
cy_object_type
)
incref_macro_type
=
PyrexTypes
.
CFuncType
(
PyrexTypes
.
c_void_type
,
[
PyrexTypes
.
CFuncTypeArg
(
"obj"
,
PyrexTypes
.
cy_object_type
,
None
)],
nogil
=
1
)
# The decref macros set their argument to NULL when the counter reaches 0,
# so we pretend to Cython that it's a c++ function with the argument passed by reference.
# This keeps the compiler from using std::move when calling the macro for instance.
decref_macro_type
=
PyrexTypes
.
CFuncType
(
PyrexTypes
.
c_void_type
,
[
PyrexTypes
.
CFuncTypeArg
(
"obj"
,
reference_to_cy_object_type
,
None
)],
nogil
=
1
)
for
macro
,
macro_type
in
[(
"Cy_INCREF"
,
incref_macro_type
),
(
"Cy_DECREF"
,
decref_macro_type
),
(
"Cy_XDECREF"
,
decref_macro_type
)]:
builtin_scope
.
declare_builtin_cfunction
(
macro
,
macro_type
,
macro
)
def
inject_cypclass_lock_macros
():
...
...
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