On 4/14/16 2:25 PM, [email protected] wrote:
> readline5 binaries from gnuwin32. windows 7
>  
> When i try to use readline/history from a msvc programm i get crashes. The
> reason is that readline returns pointers that are required to be freed but
> readline offers no free function to do that. Note that i cannot use the
> normal free function becasue that would link to the msvc free function
> which is incompatible with the malloc function used by the librarly which
> was most likeley compiled with gcc (mingw).
>  
> the proper fix here would be to export a void rl_free(void* p); function in
> the headers which is just defined as void rl_free( void* p ) { free(p); }
> in the c file. (and similar rl_malloc)

Readline uses xmalloc and xrealloc to allocate its memory, and, since
at least readline-5.0, provides an xfree() function to free it.
Beginning with readline-6.0, there is also an rl_free function should
you want to use it.


-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    [email protected]    http://cnswww.cns.cwru.edu/~chet/

_______________________________________________
Bug-readline mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-readline

Reply via email to