1curs_memleaks(3X)                                            curs_memleaks(3X)
2
3
4

NAME

6       _nc_freeall, _nc_free_and_exit, _nc_free_tinfo - curses memory-leak
7       checking
8

SYNOPSIS

10       #include <curses.h>
11
12       void _nc_freeall(void);
13       void _nc_free_and_exit(int);
14       void _nc_free_tinfo(int);
15

DESCRIPTION

17       These functions are used to simplify analysis of memory  leaks  in  the
18       ncurses library.  They are normally not available; they must be config‐
19       ured into the library at build time using the  --disable-leaks  option.
20       That  compiles-in  code  that  frees  memory that normally would not be
21       freed.
22
23       Any implementation of curses must not free the memory associated with a
24       screen, since (even after calling endwin), it must be available for use
25       in the next call to refresh(3X).  There are also chunks of memory  held
26       for performance reasons.  That makes it hard to analyze curses applica‐
27       tions for memory leaks.  When using the specially configured  debugging
28       version  of  the ncurses library, applications can call functions which
29       free those chunks of memory, simplifying  the  process  of  memory-leak
30       checking.
31
32       These functions are named with a “_nc_” prefix because they are not in‐
33       tended for use in the non-debugging library:
34
35       _nc_freeall
36            This frees (almost) all of the memory allocated by ncurses.
37
38       _nc_free_and_exit
39            This frees the memory allocated by ncurses (like _nc_freeall), and
40            exits the program.  It is preferred over _nc_freeall since some of
41            that memory may be required to keep the application running.  Sim‐
42            ply exiting (with the given exit-code) is safer.
43
44       _nc_free_tinfo
45            Use  this  function  if only the low-level terminfo functions (and
46            corresponding library) are used.  Like _nc_free_and_exit, it exits
47            the program after freeing memory.
48

RETURN VALUE

50       These functions do not return a value.
51

PORTABILITY

53       These functions are not part of X/Open Curses; nor do other implementa‐
54       tions of curses provide a similar feature.
55

SEE ALSO

57       curses(3X).
58
59
60
61                                                             curs_memleaks(3X)
Impressum