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
Gwenaël Samain
cython
Commits
cd32184f
Commit
cd32184f
authored
Apr 22, 2012
by
Mark Florisson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable tp_traverse-al of memslice.memview
parent
69b44fc6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+11
-6
No files found.
Cython/Compiler/ModuleNode.py
View file @
cd32184f
...
@@ -1178,22 +1178,26 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
...
@@ -1178,22 +1178,26 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
.
putln
(
code
.
putln
(
"}"
)
"}"
)
for
entry
in
py_buffers
+
memoryview_slices
:
# Do not traverse memoryview attributes of memoryview slices
# When triggered by the GC, it would cause multiple visits (gc_refs
# subtractions which is not matched by its reference count!)
for
entry
in
py_buffers
:
# + memoryview_slices:
if
entry
.
type
==
PyrexTypes
.
c_py_buffer_type
:
if
entry
.
type
==
PyrexTypes
.
c_py_buffer_type
:
cname
=
entry
.
cname
+
".obj"
cname
=
entry
.
cname
+
".obj"
else
:
else
:
# traverse the memoryview object, which should traverse the
# traverse the memoryview object, which should traverse the
# object exposing the buffer
# object exposing the buffer
cname
=
entry
.
cname
+
".memview"
# cname = entry.cname + ".memview"
pass
code
.
putln
(
"if (p->%s) {"
%
cname
)
code
.
putln
(
"if (p->%s) {"
%
cname
)
code
.
putln
(
"e = (*v)(p->%s, a); if (e) return e;"
%
cname
)
code
.
putln
(
"e = (*v)(p->%s, a); if (e) return e;"
%
cname
)
code
.
putln
(
"}"
)
code
.
putln
(
"}"
)
if
cclass_entry
.
cname
==
'__pyx_memoryviewslice'
:
#
if cclass_entry.cname == '__pyx_memoryviewslice':
code
.
putln
(
"if (p->from_slice.memview) {"
)
#
code.putln("if (p->from_slice.memview) {")
code
.
putln
(
"e = (*v)((PyObject *) p->from_slice.memview, a); if (e) return e;"
)
#
code.putln( "e = (*v)((PyObject *) p->from_slice.memview, a); if (e) return e;")
code
.
putln
(
"}"
)
#
code.putln("}")
code
.
putln
(
code
.
putln
(
"return 0;"
)
"return 0;"
)
...
@@ -1241,6 +1245,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
...
@@ -1241,6 +1245,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
.
putln
(
"Py_XDECREF(tmp);"
)
code
.
putln
(
"Py_XDECREF(tmp);"
)
for
entry
in
py_buffers
:
for
entry
in
py_buffers
:
# Note: shouldn't this call __Pyx_ReleaseBuffer ??
code
.
putln
(
"Py_CLEAR(p->%s.obj);"
%
entry
.
cname
)
code
.
putln
(
"Py_CLEAR(p->%s.obj);"
%
entry
.
cname
)
if
cclass_entry
.
cname
==
'__pyx_memoryviewslice'
:
if
cclass_entry
.
cname
==
'__pyx_memoryviewslice'
:
...
...
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