Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
eec91057
Commit
eec91057
authored
Apr 08, 2014
by
Damien George
Browse files
py: Add comment mpz function, and free memory used for string printing.
parent
2b009198
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/mpz.c
View file @
eec91057
...
...
@@ -1255,7 +1255,7 @@ uint mpz_as_str_inpl(const mpz_t *i, uint base, const char *prefix, char base_ch
return
s
-
str
;
}
// make a copy of mpz digits
// make a copy of mpz digits
, so we can do the div/mod calculation
mpz_dig_t
*
dig
=
m_new
(
mpz_dig_t
,
ilen
);
memcpy
(
dig
,
i
->
dig
,
ilen
*
sizeof
(
mpz_dig_t
));
...
...
@@ -1295,6 +1295,9 @@ uint mpz_as_str_inpl(const mpz_t *i, uint base, const char *prefix, char base_ch
}
while
(
!
done
);
// free the copy of the digits array
m_del
(
mpz_dig_t
,
dig
,
ilen
);
if
(
prefix
)
{
const
char
*
p
=
&
prefix
[
strlen
(
prefix
)];
while
(
p
>
prefix
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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