Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
be56b96d
Commit
be56b96d
authored
Jul 20, 2015
by
Chris Toshok
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a note about a solution to always creating the tuple here
parent
dfca16cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
src/runtime/file.cpp
src/runtime/file.cpp
+3
-0
No files found.
src/runtime/file.cpp
View file @
be56b96d
...
...
@@ -480,6 +480,9 @@ static PyObject* file_write(BoxedFile* f, Box* arg) noexcept {
if
(
!
f
->
writable
)
return
err_mode
(
"writing"
);
if
(
f
->
f_binary
)
{
// NOTE: this call will create a new tuple every time we write to a binary file. if/when this becomes hot or
// creates too much GC pressure, we can fix it by adding a Pyston specific versino of PyArg_ParseTuple that
// (instead of taking a tuple) takes length + Box**. Then we'd call that directly here (passing "1, &arg").
if
(
!
PyArg_ParseTuple
(
BoxedTuple
::
create
({
arg
}),
"s*"
,
&
pbuf
))
return
NULL
;
s
=
(
const
char
*
)
pbuf
.
buf
;
...
...
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