[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-readline] unfreed memory allocated within rl_initialize
From: |
Andreas Grapentin |
Subject: |
Re: [Bug-readline] unfreed memory allocated within rl_initialize |
Date: |
Thu, 27 Nov 2014 19:25:09 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.8.0 |
On 11/27/2014 07:17 PM, Chet Ramey wrote:
> On 11/27/14 6:58 AM, Andreas Grapentin wrote:
>> Hello,
>>
>> I am currently trying to verify that an application of mine does not
>> leak memory, and I noticed that the readline library does not free some
>> allocations below the rl_initialize function.
> This is not unexpected; there are data structures like keymaps that
> readline allocates once the first time it is called and expects to
> persist through all calls to readline() by a particular application.
> What does a memory allocation profiler like valgrind say about where
> the blocks were allocated and whether or not the library retains
> pointers to those blocks?
>
> Chet
>
Hi Chet,
valgrind will probably claim that these blocks are still reachable at
program exit, but that is beside the point. I am not claiming that
readline leaks memory, I claim that the unfreed allocations at exit
produce noise that makes it harder to find real memory leaks.
IMO, it would be nice to have a rl_finalize() function, that explicitly
releases the resources held by the library.
kind Regards,
Andreas