*** empty log message ***
authorJim Blandy <jimb@red-bean.com>
Wed, 7 Oct 1998 20:06:29 +0000 (20:06 +0000)
committerJim Blandy <jimb@red-bean.com>
Wed, 7 Oct 1998 20:06:29 +0000 (20:06 +0000)
NEWS
libguile/ChangeLog

diff --git a/NEWS b/NEWS
index 74c8977..bdba4bb 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -526,7 +526,6 @@ are now incorrect, since they will return early, and fail to mark any
 other objects the smob refers to.  Some code in the Guile library used
 to work this way.
 
-
 ** Function: int scm_internal_select (int fds,
                                      SELECT_TYPE *rfds,
                                      SELECT_TYPE *wfds,
@@ -603,6 +602,26 @@ Body functions to scm_internal_catch and friends do not any longer
 take a second argument.  This is because it is no longer possible to
 pass a #f arg to catch.
 
+** Calls to scm_protect_object and scm_unprotect now nest properly.
+
+The function scm_protect_object protects its argument from being freed
+by the garbage collector.  scm_unprotect_object removes that
+protection.
+
+These functions now nest properly.  That is, for every object O, there
+is a counter which scm_protect_object(O) increments and
+scm_unprotect_object(O) decrements, if the counter is greater than
+zero.  Every object's counter is zero when it is first created.  If an
+object's counter is greater than zero, the garbage collector will not
+reclaim its storage.
+
+This allows you to use scm_protect_object in your code without
+worrying that some other function you call will call
+scm_unprotect_object, and allow it to be freed.  Assuming that the
+functions you call are well-behaved, and unprotect only those objects
+they protect, you can follow the same rule and have confidence that
+objects will be freed only at appropriate times.
+
 \f
 Changes in Guile 1.2 (released Tuesday, June 24 1997):
 
index 4515a19..f273b3c 100644 (file)
@@ -1,5 +1,9 @@
 1998-10-07  Jim Blandy  <jimb@zwingli.cygnus.com>
 
+       * gc.c (scm_unprotect_object): Change this so that calls to
+       scm_protect_object and scm_unprotect_object nest properly.
+       (scm_protect_object): Doc fixes.
+
        * strings.c (scm_string_set_x): Require the argument to be a
        writable string, not a substring or a symbol.
        * strings.h (SCM_RWSTRINGP, SCM_NRWSTRINGP): New predicates.