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
a0a13341
Commit
a0a13341
authored
Jan 23, 2015
by
Bob Fang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing #167: using gc allocator for gmp
parent
381e2fcd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
src/runtime/long.cpp
src/runtime/long.cpp
+14
-2
No files found.
src/runtime/long.cpp
View file @
a0a13341
...
...
@@ -385,7 +385,6 @@ Box* longRepr(BoxedLong* v) {
strcat
(
buf
,
"L"
);
auto
rtn
=
new
BoxedString
(
buf
);
free
(
buf
);
return
rtn
;
}
...
...
@@ -397,7 +396,6 @@ Box* longStr(BoxedLong* v) {
char
*
buf
=
mpz_get_str
(
NULL
,
10
,
v
->
n
);
auto
rtn
=
new
BoxedString
(
buf
);
free
(
buf
);
return
rtn
;
}
...
...
@@ -866,7 +864,21 @@ Box* longHash(BoxedLong* self) {
return
boxInt
(
n
);
}
void
*
customised_allocation
(
size_t
alloc_size
)
{
return
gc
::
gc_alloc
(
alloc_size
,
gc
::
GCKind
::
CONSERVATIVE
);
}
void
*
customised_realloc
(
void
*
ptr
,
size_t
old_size
,
size_t
new_size
)
{
return
gc
::
gc_realloc
(
ptr
,
new_size
);
}
void
customised_free
(
void
*
ptr
,
size_t
size
)
{
gc
::
gc_free
(
ptr
);
}
void
setupLong
()
{
mp_set_memory_functions
(
customised_allocation
,
customised_realloc
,
customised_free
);
long_cls
->
giveAttr
(
"__name__"
,
boxStrConstant
(
"long"
));
long_cls
->
giveAttr
(
...
...
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