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
b528ca09
Commit
b528ca09
authored
Nov 12, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gets farther
parent
b9ed25a8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
src/runtime/list.cpp
src/runtime/list.cpp
+10
-6
src/runtime/types.cpp
src/runtime/types.cpp
+2
-2
No files found.
src/runtime/list.cpp
View file @
b528ca09
...
...
@@ -756,6 +756,9 @@ Box* listIAdd(BoxedList* self, Box* _rhs) {
memcpy
(
self
->
elts
->
elts
+
s1
,
rhs
->
elts
->
elts
,
sizeof
(
rhs
->
elts
->
elts
[
0
])
*
s2
);
self
->
size
=
s1
+
s2
;
for
(
int
i
=
0
;
i
<
s2
;
i
++
)
{
Py_INCREF
(
self
->
elts
->
elts
[
i
+
s1
]);
}
Py_INCREF
(
self
);
return
self
;
...
...
@@ -774,6 +777,9 @@ Box* listIAdd(BoxedList* self, Box* _rhs) {
memcpy
(
self
->
elts
->
elts
+
s1
,
rhs
->
elts
,
sizeof
(
self
->
elts
->
elts
[
0
])
*
s2
);
self
->
size
=
s1
+
s2
;
for
(
int
i
=
0
;
i
<
s2
;
i
++
)
{
Py_INCREF
(
self
->
elts
->
elts
[
i
+
s1
]);
}
Py_INCREF
(
self
);
return
self
;
...
...
@@ -1099,14 +1105,10 @@ extern "C" PyObject* PyList_New(Py_ssize_t size) noexcept {
try
{
BoxedList
*
l
=
new
BoxedList
();
if
(
size
)
{
// This function is supposed to return a list of `size` NULL elements.
// That will probably trip an assert somewhere if we try to create that (ex
// I think the GC will expect them to be real objects so they can be relocated),
// so put None in instead
l
->
ensure
(
size
);
for
(
Py_ssize_t
i
=
0
;
i
<
size
;
i
++
)
{
l
->
elts
->
elts
[
i
]
=
N
one
;
l
->
elts
->
elts
[
i
]
=
N
ULL
;
}
l
->
size
=
size
;
}
...
...
@@ -1222,7 +1224,9 @@ extern "C" PyObject* _PyList_Extend(PyListObject* self, PyObject* b) noexcept {
assert
(
PyList_Check
(
l
));
try
{
return
listIAdd
(
l
,
b
);
Box
*
r
=
listIAdd
(
l
,
b
);
Py_DECREF
(
r
);
Py_RETURN_NONE
;
}
catch
(
ExcInfo
e
)
{
setCAPIException
(
e
);
return
NULL
;
...
...
src/runtime/types.cpp
View file @
b528ca09
...
...
@@ -3693,14 +3693,14 @@ void BoxedList::dealloc(Box* b) noexcept {
while
(
--
i
>=
0
)
{
Py_XDECREF
(
op
->
elts
->
elts
[
i
]);
}
PyMem_FREE
(
op
->
elts
);
//
PyMem_FREE(op->elts);
}
#if 0
if (numfree < PyList_MAXFREELIST && PyList_CheckExact(op))
free_list[numfree++] = op;
else
#endif
Py_TYPE
(
op
)
->
tp_free
((
PyObject
*
)
op
);
Py_TYPE
(
op
)
->
tp_free
((
PyObject
*
)
op
);
Py_TRASHCAN_SAFE_END
(
op
)
}
...
...
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