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
a31e0325
Commit
a31e0325
authored
May 21, 2016
by
Marius Wachtler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
revert some pyston changes now that we have ob_refcnt
parent
ea4cd6e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
10 deletions
+5
-10
from_cpython/Modules/_io/textio.c
from_cpython/Modules/_io/textio.c
+5
-10
No files found.
from_cpython/Modules/_io/textio.c
View file @
a31e0325
...
@@ -305,9 +305,8 @@ _PyIncrementalNewlineDecoder_decode(PyObject *_self,
...
@@ -305,9 +305,8 @@ _PyIncrementalNewlineDecoder_decode(PyObject *_self,
if
(
!
final
)
{
if
(
!
final
)
{
if
(
output_len
>
0
if
(
output_len
>
0
&&
PyUnicode_AS_UNICODE
(
output
)[
output_len
-
1
]
==
'\r'
)
{
&&
PyUnicode_AS_UNICODE
(
output
)[
output_len
-
1
]
==
'\r'
)
{
// Pyston change:
// if (Py_REFCNT(output) == 1) {
if
(
Py_REFCNT
(
output
)
==
1
)
{
if
(
0
)
{
if
(
PyUnicode_Resize
(
&
output
,
output_len
-
1
)
<
0
)
if
(
PyUnicode_Resize
(
&
output
,
output_len
-
1
)
<
0
)
goto
error
;
goto
error
;
}
}
...
@@ -406,9 +405,7 @@ _PyIncrementalNewlineDecoder_decode(PyObject *_self,
...
@@ -406,9 +405,7 @@ _PyIncrementalNewlineDecoder_decode(PyObject *_self,
PyObject
*
translated
=
NULL
;
PyObject
*
translated
=
NULL
;
Py_UNICODE
*
out_str
;
Py_UNICODE
*
out_str
;
Py_UNICODE
*
in
,
*
out
,
*
end
;
Py_UNICODE
*
in
,
*
out
,
*
end
;
// Pyston change
if
(
Py_REFCNT
(
output
)
!=
1
)
{
// if (Py_REFCNT(output) != 1) {
if
(
1
)
{
/* We could try to optimize this so that we only do a copy
/* We could try to optimize this so that we only do a copy
when there is something to translate. On the other hand,
when there is something to translate. On the other hand,
most decoders should only output non-shared strings, i.e.
most decoders should only output non-shared strings, i.e.
...
@@ -416,7 +413,7 @@ _PyIncrementalNewlineDecoder_decode(PyObject *_self,
...
@@ -416,7 +413,7 @@ _PyIncrementalNewlineDecoder_decode(PyObject *_self,
translated
=
PyUnicode_FromUnicode
(
NULL
,
len
);
translated
=
PyUnicode_FromUnicode
(
NULL
,
len
);
if
(
translated
==
NULL
)
if
(
translated
==
NULL
)
goto
error
;
goto
error
;
// assert(Py_REFCNT(translated) == 1); Pyston change
assert
(
Py_REFCNT
(
translated
)
==
1
);
memcpy
(
PyUnicode_AS_UNICODE
(
translated
),
memcpy
(
PyUnicode_AS_UNICODE
(
translated
),
PyUnicode_AS_UNICODE
(
output
),
PyUnicode_AS_UNICODE
(
output
),
len
*
sizeof
(
Py_UNICODE
));
len
*
sizeof
(
Py_UNICODE
));
...
@@ -1801,9 +1798,7 @@ _textiowrapper_readline(textio *self, Py_ssize_t limit)
...
@@ -1801,9 +1798,7 @@ _textiowrapper_readline(textio *self, Py_ssize_t limit)
/* Our line ends in the current buffer */
/* Our line ends in the current buffer */
self
->
decoded_chars_used
=
endpos
-
offset_to_buffer
;
self
->
decoded_chars_used
=
endpos
-
offset_to_buffer
;
if
(
start
>
0
||
endpos
<
PyUnicode_GET_SIZE
(
line
))
{
if
(
start
>
0
||
endpos
<
PyUnicode_GET_SIZE
(
line
))
{
// Pyston change:
if
(
start
==
0
&&
Py_REFCNT
(
line
)
==
1
)
{
// if (start == 0 && Py_REFCNT(line) == 1) {
if
(
0
)
{
if
(
PyUnicode_Resize
(
&
line
,
endpos
)
<
0
)
if
(
PyUnicode_Resize
(
&
line
,
endpos
)
<
0
)
goto
error
;
goto
error
;
}
}
...
...
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