bug-readline
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-readline] readline crashes when used from msvc


From: Chet Ramey
Subject: Re: [Bug-readline] readline crashes when used from msvc
Date: Fri, 15 Apr 2016 09:50:34 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.7.2

On 4/14/16 2:25 PM, address@hidden 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    address@hidden    http://cnswww.cns.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]