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
41c28bcd
Commit
41c28bcd
authored
Nov 27, 2008
by
Dag Sverre Seljebotn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make a few common cases not use temporary for buffer acquisition
parent
4ee0a2df
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+11
-5
No files found.
Cython/Compiler/ExprNodes.py
View file @
41c28bcd
...
...
@@ -1227,15 +1227,21 @@ class NameNode(AtomicExprNode):
# rhstmp is only used in case the rhs is a complicated expression leading to
# the object, to avoid repeating the same C expression for every reference
# to the rhs. It does NOT hold a reference.
pretty_rhs
=
isinstance
(
rhs
,
NameNode
)
or
rhs
.
is_temp
if
pretty_rhs
:
rhstmp
=
rhs
.
result_as
(
self
.
ctype
())
else
:
rhstmp
=
code
.
funcstate
.
allocate_temp
(
self
.
entry
.
type
,
manage_ref
=
False
)
buffer_aux
=
self
.
entry
.
buffer_aux
bufstruct
=
buffer_aux
.
buffer_info_var
.
cname
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
,
is_initialized
=
not
self
.
lhs_of_first_assignment
,
pos
=
self
.
pos
,
code
=
code
)
if
not
pretty_rhs
:
code
.
putln
(
"%s = 0;"
%
rhstmp
)
code
.
funcstate
.
release_temp
(
rhstmp
)
...
...
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