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
Kirill Smelkov
cython
Commits
eabb40f2
Commit
eabb40f2
authored
May 27, 2009
by
Kurt Smith
Committed by
Mark Florisson
Sep 30, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
partial fix of #299. Refactored buffer auxiliary vars.
parent
e97c6e59
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
121 additions
and
76 deletions
+121
-76
Cython/Compiler/Buffer.py
Cython/Compiler/Buffer.py
+101
-60
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+1
-3
Cython/Compiler/Naming.py
Cython/Compiler/Naming.py
+2
-4
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+2
-3
Cython/Compiler/Options.py
Cython/Compiler/Options.py
+3
-0
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+9
-0
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+3
-6
No files found.
Cython/Compiler/Buffer.py
View file @
eabb40f2
This diff is collapsed.
Click to expand it.
Cython/Compiler/ExprNodes.py
View file @
eabb40f2
...
...
@@ -1699,10 +1699,8 @@ class NameNode(AtomicExprNode):
rhstmp
=
code
.
funcstate
.
allocate_temp
(
self
.
entry
.
type
,
manage_ref
=
False
)
code
.
putln
(
'%s = %s;'
%
(
rhstmp
,
rhs
.
result_as
(
self
.
ctype
())))
buffer_aux
=
self
.
entry
.
buffer_aux
bufstruct
=
buffer_aux
.
buffer_info_var
.
cname
import
Buffer
Buffer
.
put_assign_to_buffer
(
self
.
result
(),
rhstmp
,
buffer_aux
,
self
.
entry
.
type
,
Buffer
.
put_assign_to_buffer
(
self
.
result
(),
rhstmp
,
self
.
entry
,
is_initialized
=
not
self
.
lhs_of_first_assignment
,
pos
=
self
.
pos
,
code
=
code
)
...
...
Cython/Compiler/Naming.py
View file @
eabb40f2
...
...
@@ -38,10 +38,8 @@ typeobj_prefix = pyrex_prefix + "type_"
var_prefix
=
pyrex_prefix
+
"v_"
varptr_prefix
=
pyrex_prefix
+
"vp_"
wrapperbase_prefix
=
pyrex_prefix
+
"wrapperbase_"
bufstruct_prefix
=
pyrex_prefix
+
"bstruct_"
bufstride_prefix
=
pyrex_prefix
+
"bstride_"
bufshape_prefix
=
pyrex_prefix
+
"bshape_"
bufsuboffset_prefix
=
pyrex_prefix
+
"boffset_"
pybuffernd_prefix
=
pyrex_prefix
+
"pybuffernd_"
pybufferstruct_prefix
=
pyrex_prefix
+
"pybuffer_"
vtable_prefix
=
pyrex_prefix
+
"vtable_"
vtabptr_prefix
=
pyrex_prefix
+
"vtabptr_"
vtabstruct_prefix
=
pyrex_prefix
+
"vtabstruct_"
...
...
Cython/Compiler/Nodes.py
View file @
eabb40f2
...
...
@@ -1405,9 +1405,8 @@ class FuncDefNode(StatNode, BlockNode):
code
.
put_var_incref
(
entry
)
# ----- Initialise local buffer auxiliary variables
for
entry
in
lenv
.
var_entries
+
lenv
.
arg_entries
:
if
entry
.
type
.
is_buffer
and
entry
.
buffer_aux
.
buffer_info_var
.
used
:
code
.
putln
(
"%s.buf = NULL;"
%
entry
.
buffer_aux
.
buffer_info_var
.
cname
)
if
entry
.
type
.
is_buffer
and
entry
.
buffer_aux
.
buflocal_nd_var
.
used
:
Buffer
.
put_init_vars
(
entry
,
code
)
# ----- Check and convert arguments
self
.
generate_argument_type_tests
(
code
)
# ----- Acquire buffer arguments
...
...
Cython/Compiler/Options.py
View file @
eabb40f2
...
...
@@ -67,6 +67,9 @@ old_style_globals = False
cimport_from_pyx
=
False
# max # of dims for buffers -- set to same value as max # of dims for numpy
# arrays.
buffer_max_dims
=
32
# Declare compiler directives
directive_defaults
=
{
...
...
Cython/Compiler/PyrexTypes.py
View file @
eabb40f2
...
...
@@ -2481,6 +2481,15 @@ c_size_t_ptr_type = CPtrType(c_size_t_type)
c_py_buffer_type
=
CStructOrUnionType
(
"Py_buffer"
,
"struct"
,
None
,
1
,
"Py_buffer"
)
c_py_buffer_ptr_type
=
CPtrType
(
c_py_buffer_type
)
# buffer-related structs
c_buf_diminfo_type
=
CStructOrUnionType
(
"__Pyx_Buf_DimInfo"
,
"struct"
,
None
,
1
,
"__Pyx_Buf_DimInfo"
)
c_pyx_buffer_type
=
CStructOrUnionType
(
"__Pyx_Buffer"
,
"struct"
,
None
,
1
,
"__Pyx_Buffer"
)
c_pyx_buffer_ptr_type
=
CPtrType
(
c_pyx_buffer_type
)
c_pyx_buffer_nd_type
=
CStructOrUnionType
(
"__Pyx_LocalBuf_ND"
,
"struct"
,
None
,
1
,
"__Pyx_LocalBuf_ND"
)
error_type
=
ErrorType
()
unspecified_type
=
UnspecifiedType
()
...
...
Cython/Compiler/Symtab.py
View file @
eabb40f2
...
...
@@ -39,12 +39,9 @@ def c_safe_identifier(cname):
class BufferAux(object):
writable_needed = False
def __init__(self, buffer_info_var, stridevars, shapevars,
suboffsetvars):
self.buffer_info_var = buffer_info_var
self.stridevars = stridevars
self.shapevars = shapevars
self.suboffsetvars = suboffsetvars
def __init__(self, buflocal_nd_var, rcbuf_var):
self.buflocal_nd_var = buflocal_nd_var
self.rcbuf_var = rcbuf_var
def __repr__(self):
return "
<
BufferAux
%
r
>
" % self.__dict__
...
...
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