free memory allocated by mpf_get_str
Sisyphus
sisyphus1 at optusnet.com.au
Tue May 5 01:23:49 CEST 2009
----- Original Message -----
From: "LiuEmma" <yanjiyun2002 at hotmail.com>
> ch = mpf_get_str(NULL,&exp,10,MAX_DIGITS + 1,temp);
>
>
>
> According to the manual, If str is NULL, the result string is allocated
> using the current allocation function. So I think I should free the memory
> allocated by this function and I tried free(ch) and delete ch, but failed.
> It always said data abort.
>
=======================================
I can't reproduce the problem (on either Windows or Linux). I find that
free(ch) works fine for me.
Which compiler are you using ?
Does it make any difference if, in your program, you:
#include <malloc.h>
Cheers,
Rob
More information about the gmp-discuss
mailing list