summaryrefslogtreecommitdiff
path: root/set_str_raw.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2000-10-02 08:44:58 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2000-10-02 08:44:58 +0000
commit253b2b161b5243a556a67e7ccce760ac314a206f (patch)
treec68d5fd57931a1291038371e25deda5c28bd9886 /set_str_raw.c
parenta04e726916edbafec108c6884b9520d6dd26cdfe (diff)
downloadmpfr-253b2b161b5243a556a67e7ccce760ac314a206f.tar.gz
malloc -> *_mp_allocate_func or TMP_ALLOC
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@778 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'set_str_raw.c')
-rw-r--r--set_str_raw.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/set_str_raw.c b/set_str_raw.c
index d0945c4bc..2629690f4 100644
--- a/set_str_raw.c
+++ b/set_str_raw.c
@@ -45,12 +45,13 @@ mpfr_set_str_raw(x, str)
#endif
{
char *str2, *str0, negative = 0;
- unsigned long j, l, k = 0, xsize, cnt; mp_limb_t *xp;
+ unsigned long j, l, k = 0, xsize, cnt, alloc; mp_limb_t *xp;
long expn = 0, e; char *endstr2;
xp = x -> _mp_d;
xsize = 1 + (PREC(x)-1)/BITS_PER_MP_LIMB;
- str0 = str2 = (char *) malloc((strlen(str)+1)*sizeof(char));
+ alloc = (strlen(str)+1) * sizeof(char);
+ str0 = str2 = (char *) (*_mp_allocate_func) (alloc);
if (*str == '-') { negative = 1; str++; }
else if (*str == '+') str++;
@@ -105,7 +106,7 @@ mpfr_set_str_raw(x, str)
x -> _mp_exp = expn - cnt;
x -> _mp_size = xsize; if (negative) CHANGE_SIGN(x);
- free(str0);
+ (*_mp_free_func) (str0, alloc);
/* May change to take into account : syntax errors, overflow in exponent,
string truncated because of size of x */