[Prev] Thread [Next] |
[Prev] Date [Next]
Re: No idn_free documentation
Mon Feb 09 03:02:51 2009
----- Original Message -----
From: "Simon Josefsson" <[EMAIL PROTECTED]>
* The theory of isolating all memory allocations and de-allocations
* within a code package (library) sounds good, to simplify hunting
* down memory allocation related problems, but I'm not sure if it is
* worth enough to motivate recommending this interface over calling
* `free' directly, though.
I hadn't read those comments in idn-free.h.
I've come across a problem with memory allocation where free() cannot be
used, and idn_free() is the only solution, afaik.
With C programs, there's no issue, but when we extend perl to interface with
libidn, on Win32, free() cannot be used in the XS code to free the memory
that was allocated by the libidn functions. As soon as free() is called we
get a "Free to wrong pool ...." fatal error. Afaik this happens only on
Win32 - it definitely doesn't happen on linux.
So, on Win32, we either have to use idn_free() in the XS code, or settle for
(Again, that's "afaik" :-)
I think that idn_free() should be documented in libidn.info (and other
pertinent places) so that people can readily find it when free() has become
unusable. And the advice in the documentation, that the memory should be
freed using free(), should also at least mention the option of using
Are there any known cases where idn_free() breaks something that's not
broken by free() ?
Thanks for the reply, Simon.
Help-libidn mailing list