bug-ncurses
[Top][All Lists]
Advanced

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

Re: Memory leak in form TYPE_REGEXP


From: Chris Zubrzycki
Subject: Re: Memory leak in form TYPE_REGEXP
Date: Tue, 6 Jan 2015 20:05:57 -0500

> On Jan 6, 2015, at 4:01 PM, Pavel Balaev <address@hidden> wrote:

> Valgrind output:

Did you happen to see the section of the Readme/FAQ about looking for leaks? 
It's at http://invisible-island.net/ncurses/ncurses.faq.html but I will quote 
it for others:



Testing for Memory Leaks

Perhaps you used a tool such as dmalloc or valgrind to check for memory leaks. 
It will normally report a lot of memory still in use. That is normal.

The ncurses configure script has an option, --disable-leaks, which you can use 
to continue the analysis. It tells ncurses to free memory if possible. However, 
most of the in-use memory is "permanent".

Any implementation of curses must not free the memory associated with a screen, 
since (even after calling endwin()), it must be available for use in the next 
call to refresh(). There are also chunks of memory held for performance 
reasons. That makes it hard to analyze curses applications for memory leaks. To 
work around this, build a debugging version of the ncurses library which frees 
those chunks which it can, and provides the _nc_free_and_exit() function to 
free the remainder on exit. The ncurses utility and test programs use this 
feature, e.g., via the ExitProgram() macro.




-chris zubrzycki
- --
PGP public key: http://homepage.mac.com/beren/publickey.txt
ID: 0xA2ABC070
Fingerprint: 26B0 BA6B A409 FA83 42B3  1688 FBF9 8232 A2AB C070
========================================================
Everyone who comes in here wants three things:
        (1) They want it quick.
        (2) They want it good.
        (3) They want it cheap.
I tell 'em to pick two and call me back.
                -- sign on the back wall of a small printing company






reply via email to

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