Question re mpf_get_str

Bruce M. Axtens bruce.axtens at gmail.com
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,
Bruce.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gmplib.org/list-archives/gmp-discuss/attachments/20090118/ca08093f/attachment.html 


More information about the gmp-discuss mailing list