From: Jim Blandy Date: Wed, 7 Oct 1998 20:06:29 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.hcoop.net/bpt/guile.git/commitdiff_plain/a8e050093217c81ac34ae733f4ffad9c9a14467c?hp=dab7f56692ea27c3a57e1932aed3a5a9204c6e91 *** empty log message *** --- diff --git a/NEWS b/NEWS index 74c8977e6..bdba4bb43 100644 --- 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. + Changes in Guile 1.2 (released Tuesday, June 24 1997): diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 4515a19ed..f273b3ce2 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,5 +1,9 @@ 1998-10-07 Jim Blandy + * 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.