+</PRE><H3><a name="h3-Releasing-Memory">Releasing Memory</a></H3><PRE>
+ The termcap functions provide no means for freeing memory, because
+ legacy termcap implementations used only the buffer areas provided by
+ the caller via <STRONG>tgetent</STRONG> and <STRONG>tgetstr</STRONG>. Those buffers are unused in ter-
+ minfo.
+
+ On the other hand, terminfo allocates memory. It uses <STRONG>setupterm</STRONG> to re-
+ trieve the data used by <STRONG>tgetent</STRONG> and the functions which return capabil-
+ ity values such as <STRONG>tgetstr</STRONG>. One could use
+
+ <STRONG>del_curterm(cur_term);</STRONG>
+
+
+ to free this memory, but there is an additional complication with
+ ncurses. It uses a fixed-size <EM>pool</EM> of storage locations, one per set-
+ ting of the <STRONG>TERM</STRONG> variable when <STRONG>tgetent</STRONG> is called. The <STRONG>screen(1)</STRONG> pro-
+ gram relies upon this arrangement, to improve its performance.
+
+ An application which uses only the low-level termcap functions could
+ free the memory using <STRONG>del_curterm</STRONG>, because the pool is freed using oth-
+ er functions (see <STRONG><A HREF="curs_memleaks.3x.html">curs_memleaks(3x)</A></STRONG>).
+
+