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
b63867bd
Commit
b63867bd
authored
Nov 14, 2014
by
Marius Wachtler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix memory leak
parent
dff7b960
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
+4
-6
src/runtime/str.cpp
src/runtime/str.cpp
+3
-5
src/runtime/types.cpp
src/runtime/types.cpp
+1
-1
No files found.
src/runtime/str.cpp
View file @
b63867bd
...
...
@@ -250,13 +250,11 @@ extern "C" Box* strMul(BoxedString* lhs, Box* rhs) {
// TODO: use createUninitializedString and getWriteableStringContents
int
sz
=
lhs
->
s
.
size
();
char
*
buf
=
new
char
[
sz
*
n
+
1
]
;
std
::
string
buf
(
sz
*
n
,
'\0'
)
;
for
(
int
i
=
0
;
i
<
n
;
i
++
)
{
memcpy
(
buf
+
(
sz
*
i
)
,
lhs
->
s
.
c_str
(),
sz
);
memcpy
(
&
buf
[
sz
*
i
]
,
lhs
->
s
.
c_str
(),
sz
);
}
buf
[
sz
*
n
]
=
'\0'
;
return
new
BoxedString
(
buf
);
return
new
BoxedString
(
std
::
move
(
buf
));
}
extern
"C"
Box
*
strLt
(
BoxedString
*
lhs
,
Box
*
rhs
)
{
...
...
src/runtime/types.cpp
View file @
b63867bd
...
...
@@ -549,7 +549,7 @@ Box* sliceRepr(BoxedSlice* self) {
BoxedString
*
stop
=
static_cast
<
BoxedString
*>
(
repr
(
self
->
stop
));
BoxedString
*
step
=
static_cast
<
BoxedString
*>
(
repr
(
self
->
step
));
std
::
string
s
=
"slice("
+
start
->
s
+
", "
+
stop
->
s
+
", "
+
step
->
s
+
")"
;
return
new
BoxedString
(
s
);
return
new
BoxedString
(
s
td
::
move
(
s
)
);
}
Box
*
typeRepr
(
BoxedClass
*
self
)
{
...
...
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