Question re mpf_get_str

Bruce M. Axtens bruce.axtens at
Sat Jan 17 17:18:36 CET 2009

According to the v4.2.4 manual, mpf_get_str can be called with a NULL in 
the first argument:

    If str is NULL, the result string is allocated using the current
    allocation function (see
    Chapter 14 [Custom Allocation], page 85). The block will be
    strlen(str)+1 bytes, that
    being exactly enough for the string and null-terminator.

What I'd like to know is whether this block needs to be freed, and if 
so, how? Is it simply a case of

    free( ptr, strlen(ptr)+1);


Kind regards,

-------------- next part --------------
An HTML attachment was scrubbed...

More information about the gmp-discuss mailing list