Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1 | .\"*************************************************************************** |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 2 | .\" Copyright (c) 2008,2010 Free Software Foundation, Inc. * |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 3 | .\" * |
| 4 | .\" Permission is hereby granted, free of charge, to any person obtaining a * |
| 5 | .\" copy of this software and associated documentation files (the * |
| 6 | .\" "Software"), to deal in the Software without restriction, including * |
| 7 | .\" without limitation the rights to use, copy, modify, merge, publish, * |
| 8 | .\" distribute, distribute with modifications, sublicense, and/or sell * |
| 9 | .\" copies of the Software, and to permit persons to whom the Software is * |
| 10 | .\" furnished to do so, subject to the following conditions: * |
| 11 | .\" * |
| 12 | .\" The above copyright notice and this permission notice shall be included * |
| 13 | .\" in all copies or substantial portions of the Software. * |
| 14 | .\" * |
| 15 | .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * |
| 16 | .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * |
| 17 | .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * |
| 18 | .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * |
| 19 | .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * |
| 20 | .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * |
| 21 | .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. * |
| 22 | .\" * |
| 23 | .\" Except as contained in this notice, the name(s) of the above copyright * |
| 24 | .\" holders shall not be used in advertising or otherwise to promote the * |
| 25 | .\" sale, use or other dealings in this Software without prior written * |
| 26 | .\" authorization. * |
| 27 | .\"*************************************************************************** |
| 28 | .\" |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 29 | .\" $Id: curs_memleaks.3x,v 1.3 2010/12/04 18:40:45 tom Exp $ |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 30 | .TH curs_memleaks 3X "" |
| 31 | .na |
| 32 | .hy 0 |
| 33 | .SH NAME |
| 34 | \fB_nc_freeall\fP |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 35 | \fB_nc_free_and_exit\fP \- \fBcurses\fR memory-leak checking |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 36 | .ad |
| 37 | .hy |
| 38 | .SH SYNOPSIS |
| 39 | \fB#include <curses.h>\fR |
| 40 | .sp |
| 41 | \fBvoid _nc_freeall(void);\fR |
| 42 | .br |
| 43 | \fBvoid _nc_free_and_exit(int);\fR |
| 44 | .SH DESCRIPTION |
| 45 | These functions are used to simplify analysis of memory leaks in the ncurses |
| 46 | library. |
| 47 | They are normally not available; they must be configured into the library |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 48 | at build time using the \fB\-\-disable-leaks\fP option. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 49 | That compiles-in code that frees memory that normally would not be freed. |
| 50 | .PP |
| 51 | Any implementation of curses must not free the memory associated with |
| 52 | a screen, since (even after calling \fBendwin\fP), it must be available |
| 53 | for use in the next call to \fBrefresh\fP. |
| 54 | There are also chunks of memory held for performance reasons. |
| 55 | That makes it hard to analyze curses applications for memory leaks. |
| 56 | To work around this, one can build a debugging version of the ncurses |
| 57 | library which frees those chunks which it can, and provides these |
| 58 | functions to free all of the memory allocated by the ncurses library. |
| 59 | .PP |
| 60 | The \fP_nc_free_and_exit\fP function is the preferred one since |
| 61 | some of the memory which is freed may be required for the application |
| 62 | to continue running. |
| 63 | Its parameter is the code to pass to the \fPexit\fP routine. |
| 64 | .SH RETURN VALUE |
| 65 | These functions do not return a value. |
| 66 | .SH PORTABILITY |
| 67 | These functions are not part of the XSI interface. |
| 68 | .SH SEE ALSO |
| 69 | \fBcurses\fR(3X). |