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
013eec6b
Commit
013eec6b
authored
Dec 18, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix reference counting in cypclass locks
parent
2fd7bc9f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
4 deletions
+11
-4
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+2
-3
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+7
-1
Cython/Utility/CyObjects.cpp
Cython/Utility/CyObjects.cpp
+2
-0
No files found.
Cython/Compiler/ExprNodes.py
View file @
013eec6b
...
@@ -14329,9 +14329,8 @@ class CoerceToLockedNode(CoercionNode):
...
@@ -14329,9 +14329,8 @@ class CoerceToLockedNode(CoercionNode):
def
generate_disposal_code
(
self
,
code
):
def
generate_disposal_code
(
self
,
code
):
# Close the scope to release the lock.
# Close the scope to release the lock.
code
.
putln
(
"}"
)
code
.
putln
(
"}"
)
# Dispose of and free subexpressions.
# Dispose of the temporary without decrefing.
self
.
arg
.
generate_subexpr_disposal_code
(
code
)
self
.
arg
.
generate_post_assignment_code
(
code
)
self
.
arg
.
free_subexpr_temps
(
code
)
class
CoerceToArgAssmtNode
(
CoercionNode
):
class
CoerceToArgAssmtNode
(
CoercionNode
):
...
...
Cython/Compiler/Nodes.py
View file @
013eec6b
...
@@ -8630,7 +8630,8 @@ class LockCypclassNode(StatNode):
...
@@ -8630,7 +8630,8 @@ class LockCypclassNode(StatNode):
self
.
obj
.
analyse_declarations
(
env
)
self
.
obj
.
analyse_declarations
(
env
)
def
analyse_expressions
(
self
,
env
):
def
analyse_expressions
(
self
,
env
):
self
.
obj
=
obj
=
self
.
obj
.
analyse_types
(
env
)
obj
=
self
.
obj
.
analyse_types
(
env
)
self
.
obj
=
obj
.
coerce_to_temp
(
env
)
self
.
body
=
self
.
body
.
analyse_expressions
(
env
)
self
.
body
=
self
.
body
.
analyse_expressions
(
env
)
if
not
obj
.
type
.
is_cyp_class
:
if
not
obj
.
type
.
is_cyp_class
:
error
(
obj
.
pos
,
"Locking non-cypclass reference"
)
error
(
obj
.
pos
,
"Locking non-cypclass reference"
)
...
@@ -8666,6 +8667,11 @@ class LockCypclassNode(StatNode):
...
@@ -8666,6 +8667,11 @@ class LockCypclassNode(StatNode):
# Close the scope to release the lock.
# Close the scope to release the lock.
code
.
putln
(
"}"
)
code
.
putln
(
"}"
)
# Dispose of the temporary without decrefing.
self
.
obj
.
generate_post_assignment_code
(
code
)
# Free the temporary.
self
.
obj
.
free_temps
(
code
)
def
cython_view_utility_code
():
def
cython_view_utility_code
():
from
.
import
MemoryView
from
.
import
MemoryView
...
...
Cython/Utility/CyObjects.cpp
View file @
013eec6b
...
@@ -320,6 +320,7 @@
...
@@ -320,6 +320,7 @@
~
Cy_rlock_guard
()
{
~
Cy_rlock_guard
()
{
if
(
this
->
o
!=
NULL
)
{
if
(
this
->
o
!=
NULL
)
{
this
->
o
->
CyObject_UNRLOCK
();
this
->
o
->
CyObject_UNRLOCK
();
this
->
o
->
CyObject_DECREF
();
}
}
else
{
else
{
fprintf
(
stderr
,
"ERROR: trying to unrlock NULL !
\n
"
);
fprintf
(
stderr
,
"ERROR: trying to unrlock NULL !
\n
"
);
...
@@ -341,6 +342,7 @@
...
@@ -341,6 +342,7 @@
~
Cy_wlock_guard
()
{
~
Cy_wlock_guard
()
{
if
(
this
->
o
!=
NULL
)
{
if
(
this
->
o
!=
NULL
)
{
this
->
o
->
CyObject_UNWLOCK
();
this
->
o
->
CyObject_UNWLOCK
();
this
->
o
->
CyObject_DECREF
();
}
}
else
{
else
{
fprintf
(
stderr
,
"ERROR: trying to unwlock NULL !
\n
"
);
fprintf
(
stderr
,
"ERROR: trying to unwlock NULL !
\n
"
);
...
...
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