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
7f1cf72d
Commit
7f1cf72d
authored
Dec 18, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix reference counting in acthon implementation
parent
23778224
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
42 deletions
+0
-42
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+0
-34
Cython/Utility/CyObjects.cpp
Cython/Utility/CyObjects.cpp
+0
-8
No files found.
Cython/Compiler/ModuleNode.py
View file @
7f1cf72d
...
...
@@ -1087,38 +1087,6 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
sync_attr_cname
=
message_base_type
.
scope
.
lookup_here
(
"_sync_method"
).
cname
result_attr_cname
=
message_base_type
.
scope
.
lookup_here
(
"_result"
).
cname
def
put_cypclass_op_on_narg_optarg
(
op_lbda
,
func_type
,
opt_arg_name
,
code
):
opt_arg_count
=
func_type
.
optional_arg_count
narg_count
=
len
(
func_type
.
args
)
-
opt_arg_count
for
narg
in
func_type
.
args
[:
narg_count
]:
if
narg
.
type
.
is_cyp_class
:
code
.
putln
(
"%s(this->%s);"
%
(
op_lbda
(
narg
),
narg
.
cname
))
if
opt_arg_count
:
opt_arg_guard
=
code
.
insertion_point
()
code
.
increase_indent
()
num_if
=
0
for
opt_idx
,
optarg
in
enumerate
(
func_type
.
args
[
narg_count
:]):
if
optarg
.
type
.
is_cyp_class
:
code
.
putln
(
"if (this->%s->%sn > %s) {"
%
(
opt_arg_name
,
Naming
.
pyrex_prefix
,
opt_idx
))
code
.
putln
(
"%s(this->%s->%s);"
%
(
op_lbda
(
optarg
),
opt_arg_name
,
func_type
.
opt_arg_cname
(
optarg
.
name
)
))
num_if
+=
1
for
_
in
range
(
num_if
):
code
.
putln
(
"}"
)
if
num_if
:
opt_arg_guard
.
putln
(
"if (this->%s != NULL) {"
%
opt_arg_name
)
code
.
putln
(
"}"
)
else
:
code
.
decrease_indent
()
for
reified_function_entry
in
entry
.
type
.
scope
.
reified_entries
:
reifying_class_name
=
"%s%s"
%
(
Naming
.
cypclass_reified_prefix
,
reified_function_entry
.
name
)
reifying_class_full_name
=
"%s::%s"
%
(
entry
.
type
.
empty_declaration_code
(),
reifying_class_name
)
...
...
@@ -1186,7 +1154,6 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
.
putln
(
"}"
)
# Acquire a ref on CyObject, as we don't know when the message will be processed
put_cypclass_op_on_narg_optarg
(
lambda
_
:
"Cy_INCREF"
,
reified_function_entry
.
type
,
Naming
.
optional_args_cname
,
code
)
code
.
putln
(
"Cy_INCREF(this->%s);"
%
target_object_cname
)
code
.
putln
(
"}"
)
...
...
@@ -1231,7 +1198,6 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
# Destructor
code
.
putln
(
"virtual ~%s() {"
%
class_name
)
code
.
putln
(
"Cy_DECREF(this->%s);"
%
target_object_cname
)
put_cypclass_op_on_narg_optarg
(
lambda
_
:
"Cy_DECREF"
,
reified_function_entry
.
type
,
Naming
.
optional_args_cname
,
code
)
if
opt_arg_count
:
code
.
putln
(
"free(this->%s);"
%
Naming
.
optional_args_cname
)
code
.
putln
(
"}"
)
...
...
Cython/Utility/CyObjects.cpp
View file @
7f1cf72d
...
...
@@ -388,7 +388,6 @@
ActhonQueueInterface
*
_active_queue_class
=
NULL
;
ActhonResultInterface
*
(
*
_active_result_class
)(
void
);
ActhonActivableClass
(){}
// Used in Activated classes inheritance chain (base Activated calls this, derived calls the 2 args version below)
ActhonActivableClass
(
ActhonQueueInterface
*
queue_object
,
ActhonResultInterface
*
(
*
result_constructor
)(
void
));
virtual
~
ActhonActivableClass
();
};
...
...
@@ -909,7 +908,6 @@ void CyObject::CyObject_UNWLOCK() const
ActhonMessageInterface
::
ActhonMessageInterface
(
ActhonSyncInterface
*
sync_method
,
ActhonResultInterface
*
result_object
)
:
_sync_method
(
sync_method
),
_result
(
result_object
)
{
Cy_INCREF
(
this
->
_sync_method
);
Cy_INCREF
(
this
->
_result
);
}
...
...
@@ -919,12 +917,6 @@ ActhonMessageInterface::~ActhonMessageInterface()
Cy_XDECREF
(
this
->
_result
);
}
ActhonActivableClass
::
ActhonActivableClass
(
ActhonQueueInterface
*
queue_object
,
ActhonResultInterface
*
(
*
result_constructor
)(
void
))
:
_active_queue_class
(
queue_object
),
_active_result_class
(
result_constructor
)
{
Cy_INCREF
(
this
->
_active_queue_class
);
}
ActhonActivableClass
::~
ActhonActivableClass
()
{
Cy_XDECREF
(
this
->
_active_queue_class
);
...
...
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