From 9879d3906e5a4de245d049fc92f4847941228143 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Sat, 3 Jan 2004 21:57:11 +0000 Subject: [PATCH] Added section about frames. --- NEWS | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 663d8608c..c8aff5b97 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,5 @@ Guile NEWS --- history of user-visible changes. -Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. +Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. See the end for copying conditions. Please send Guile bug reports to bug-guile@gnu.org. @@ -578,6 +578,36 @@ starting the week. * Changes to the C interface +** New way to deal with non-local exits and reentries. + +There is a new set of functions that essentially do what +scm_internal_dynamic_wind does, but in a more convenient way. Here is +a quick example of how to prevent a potential memory leak: + + void + foo () + { + char *mem; + + scm_begin_frame (0); + + mem = scm_malloc (100); + scm_on_unwind (free, mem, SCM_F_WIND_EXPLICITELY); + + /* MEM would leak if BAR throws an error. SCM_ON_UNWIND frees it + nevertheless. + */ + bar (); + + scm_end_frame (); + + /* Because of SCM_F_WIND_EXPLICITELY, MEM will be freed by + SCM_END_FRAME as well. + */ + } + +For full documentation, see the node "Frames" in the manual. + ** New types scm_t_intmax and scm_t_uintmax. On platforms that have them, these types are identical to intmax_t and