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
be8fad9d
Commit
be8fad9d
authored
Nov 19, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: can't call things realloc
parent
47849c8b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
4 deletions
+4
-4
from_cpython/Include/pymem.h
from_cpython/Include/pymem.h
+1
-1
src/runtime/inline/list.cpp
src/runtime/inline/list.cpp
+1
-1
src/runtime/inline/list.h
src/runtime/inline/list.h
+1
-1
src/runtime/types.h
src/runtime/types.h
+1
-1
No files found.
from_cpython/Include/pymem.h
View file @
be8fad9d
...
...
@@ -77,7 +77,7 @@ PyAPI_FUNC(void) PyMem_Free(void *) PYSTON_NOEXCEPT;
: malloc((n) ? (n) : 1))
#define PyMem_REALLOC(p, n) ((size_t)(n) > (size_t)PY_SSIZE_T_MAX ? NULL \
: realloc((p), (n) ? (n) : 1))
#define PyMem_FREE
PyMem_F
ree
#define PyMem_FREE
f
ree
#endif
/* PYMALLOC_DEBUG */
...
...
src/runtime/inline/list.cpp
View file @
be8fad9d
...
...
@@ -146,7 +146,7 @@ void BoxedList::shrink() {
if
(
capacity
>
size
*
3
)
{
int
new_capacity
=
std
::
max
(
static_cast
<
int64_t
>
(
INITIAL_CAPACITY
),
capacity
/
2
);
if
(
size
>
0
)
{
elts
=
GCdArray
::
realloc
(
elts
,
new_capacity
);
elts
=
GCdArray
::
grow
(
elts
,
new_capacity
);
capacity
=
new_capacity
;
}
else
if
(
size
==
0
)
{
delete
elts
;
...
...
src/runtime/inline/list.h
View file @
be8fad9d
...
...
@@ -29,7 +29,7 @@ inline void BoxedList::grow(int min_free) {
capacity
=
initial
;
}
else
{
int
new_capacity
=
std
::
max
(
capacity
*
2
,
size
+
min_free
);
elts
=
GCdArray
::
realloc
(
elts
,
new_capacity
);
elts
=
GCdArray
::
grow
(
elts
,
new_capacity
);
capacity
=
new_capacity
;
}
}
...
...
src/runtime/types.h
View file @
be8fad9d
...
...
@@ -538,7 +538,7 @@ public:
void
operator
delete
(
void
*
p
)
{
PyMem_FREE
(
p
);
}
static
GCdArray
*
realloc
(
GCdArray
*
array
,
int
capacity
)
{
static
GCdArray
*
grow
(
GCdArray
*
array
,
int
capacity
)
{
return
(
GCdArray
*
)
PyMem_REALLOC
(
array
,
capacity
*
sizeof
(
Box
*
)
+
sizeof
(
GCdArray
));
}
};
...
...
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