guile-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

guile/guile-core NEWS RELEASE libguile/ChangeLo...


From: Dirk Herrmann
Subject: guile/guile-core NEWS RELEASE libguile/ChangeLo...
Date: Thu, 28 Dec 2000 08:49:09 -0800

CVSROOT:        /cvs
Module name:    guile
Changes by:     Dirk Herrmann <address@hidden>  00/12/28 08:49:09

Modified files:
        guile-core     : NEWS RELEASE 
        guile-core/libguile: ChangeLog eval.c gh_data.c print.c gc.c 
                             gc.h 

Log message:
        * Fixed the changelog entry regarding re-introduction of struct member
        properties (I continuously talked of member 'documentation' instead)
        * Replace calls to scm_remember with calls to scm_remember_upto_here_1.

CVSWeb URLs:
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/NEWS.diff?r1=1.235&r2=1.236
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/RELEASE.diff?r1=1.84&r2=1.85
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/ChangeLog.diff?r1=1.1223&r2=1.1224
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/eval.c.diff?r1=1.187&r2=1.188
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/gh_data.c.diff?r1=1.48&r2=1.49
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/print.c.diff?r1=1.109&r2=1.110
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/gc.c.diff?r1=1.175&r2=1.176
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/gc.h.diff?r1=1.68&r2=1.69

Patches:
Index: guile/guile-core/NEWS
diff -u guile/guile-core/NEWS:1.235 guile/guile-core/NEWS:1.236
--- guile/guile-core/NEWS:1.235 Thu Dec 28 07:09:56 2000
+++ guile/guile-core/NEWS       Thu Dec 28 08:49:08 2000
@@ -276,6 +276,16 @@
 the case that the object is not found in the list, scm_c_memq returns #f which
 is similar to scm_memq, but different from scm_sloppy_memq's behaviour.
 
+** New functions: scm_remember_upto_here_1, scm_remember_upto_here_2, 
+scm_remember_upto_here
+
+These functions replace the function scm_remember.
+
+** Deprecated function:  scm_remember
+
+Use one of the new functions scm_remember_upto_here_1,
+scm_remember_upto_here_2 or scm_remember_upto_here instead.
+
 ** New global variable scm_gc_running_p introduced.
 
 Use this variable to find out if garbage collection is being executed.  Up to
Index: guile/guile-core/RELEASE
diff -u guile/guile-core/RELEASE:1.84 guile/guile-core/RELEASE:1.85
--- guile/guile-core/RELEASE:1.84       Thu Dec 28 07:09:56 2000
+++ guile/guile-core/RELEASE    Thu Dec 28 08:49:08 2000
@@ -41,6 +41,7 @@
     eval.c: scm_eval2, scm_eval_3
     load.c: scm_read_and_eval_x
     smob.c: scm_make_smob_type_mfpe, scm_set_smob_mfpe
+    gc.c: scm_remember
 - remove deprecated procedures:
     boot-9.scm:eval-in-module
 - remove deprecated macros: SCM_OUTOFRANGE, SCM_NALLOC, SCM_HUP_SIGNAL, 
Index: guile/guile-core/libguile/ChangeLog
diff -u guile/guile-core/libguile/ChangeLog:1.1223 
guile/guile-core/libguile/ChangeLog:1.1224
--- guile/guile-core/libguile/ChangeLog:1.1223  Thu Dec 28 08:06:56 2000
+++ guile/guile-core/libguile/ChangeLog Thu Dec 28 08:49:08 2000
@@ -1,5 +1,17 @@
 2000-12-28  Dirk Herrmann  <address@hidden>
 
+       * eval.c (check_map_args), gh_data.c (gh_set_substr,
+       gh_scm2newstr, gh_get_substr, gh_symbol2newstr), print.c
+       (scm_iprin1):  Use scm_remember_upto_here_1 instead of
+       scm_remember.
+
+       * gc.[ch] (scm_remember_upto_here_1, scm_remember_upto_here_2,
+       scm_remember_upto_here):  New functions.
+
+       (scm_remember):  Deprecated.
+
+2000-12-28  Dirk Herrmann  <address@hidden>
+
        * continuations.c (scm_make_continuation):  Make variable cont
        volatile to let the compiler know that it won't be clobbered by
        longjmp.  (It wouldn't be anyway, but for some reason the compiler
@@ -7,15 +19,15 @@
 
 2000-12-28  Dirk Herrmann  <address@hidden>
 
-       This patch re-introduces the unused member "documentation" of
+       This patch re-introduces the unused member "properties" of
        struct scm_subr_entry as requested by Mikael Djurfeldt.
 
-       * procs.h (scm_subr_entry):  Re-introduced member "documentation".
+       * procs.h (scm_subr_entry):  Re-introduced member "properties".
 
-       (SCM_SUBR_DOC):  Un-deprecated.
+       (SCM_SUBR_PROPS):  Un-deprecated.
 
        * procs.c (scm_make_subr_opt, scm_mark_subr_table):  Struct
-       scm_subr_entry has a member "documentation" again.
+       scm_subr_entry has a member "properties" again.
 
 2000-12-28  Michael Livshin  <address@hidden>
 
Index: guile/guile-core/libguile/eval.c
diff -u guile/guile-core/libguile/eval.c:1.187 
guile/guile-core/libguile/eval.c:1.188
--- guile/guile-core/libguile/eval.c:1.187      Thu Dec 21 09:51:55 2000
+++ guile/guile-core/libguile/eval.c    Thu Dec 28 08:49:09 2000
@@ -3550,7 +3550,7 @@
        scm_out_of_range (who, ve[i]);
     }
 
-  scm_remember (&argv);
+  scm_remember_upto_here_1 (argv);
 }
 
 
Index: guile/guile-core/libguile/gc.c
diff -u guile/guile-core/libguile/gc.c:1.175 
guile/guile-core/libguile/gc.c:1.176
--- guile/guile-core/libguile/gc.c:1.175        Sun Dec 24 01:54:24 2000
+++ guile/guile-core/libguile/gc.c      Thu Dec 28 08:49:09 2000
@@ -2316,12 +2316,59 @@
  */
 
 
+/*
+ * If within a function you need to protect one or more scheme objects from
+ * garbage collection, pass them as parameters to one of the
+ * scm_remember_upto_here* functions below.  These functions don't do
+ * anything, but since the compiler does not know that they are actually
+ * no-ops, it will generate code that calls these functions with the given
+ * parameters.  Therefore, you can be sure that the compiler will keep those
+ * scheme values alive (on the stack or in a register) up to the point where
+ * scm_remember_upto_here* is called.  In other words, place the call to
+ * scm_remember_upt_here* _behind_ the last code in your function, that
+ * depends on the scheme object to exist.
+ *
+ * Example: We want to make sure, that the string object str does not get
+ * garbage collected during the execution of 'some_function', because
+ * otherwise the characters belonging to str would be freed and
+ * 'some_function' might access freed memory.  To make sure that the compiler
+ * keeps str alive on the stack or in a register such that it is visible to
+ * the conservative gc we add the call to scm_remember_upto_here_1 _after_ the
+ * call to 'some_function'.  Note that this would not be necessary if str was
+ * used anyway after the call to 'some_function'.
+ *   char *chars = SCM_STRING_CHARS (str);
+ *   some_function (chars);
+ *   scm_remember_upto_here_1 (str);  // str will be alive up to this point.
+ */
+
+void
+scm_remember_upto_here_1 (SCM obj)
+{
+  /* Empty.  Protects a single object from garbage collection. */
+}
+
+void
+scm_remember_upto_here_2 (SCM obj1, SCM obj2)
+{
+  /* Empty.  Protects two objects from garbage collection. */
+}
+
+void
+scm_remember_upto_here (SCM obj, ...)
+{
+  /* Empty.  Protects any number of objects from garbage collection. */
+}
+
+
+#if (SCM_DEBUG_DEPRECATED == 0)
+
 void
 scm_remember (SCM *ptr)
 {
   /* empty */ 
 }
 
+#endif  /* SCM_DEBUG_DEPRECATED == 0 */
 
 /*
   These crazy functions prevent garbage collection
Index: guile/guile-core/libguile/gc.h
diff -u guile/guile-core/libguile/gc.h:1.68 guile/guile-core/libguile/gc.h:1.69
--- guile/guile-core/libguile/gc.h:1.68 Sat Dec 23 15:00:23 2000
+++ guile/guile-core/libguile/gc.h      Thu Dec 28 08:49:09 2000
@@ -349,7 +349,9 @@
 extern void scm_done_malloc (long size);
 extern void scm_done_free (long size);
 extern void scm_must_free (void *obj);
-extern void scm_remember (SCM * ptr);
+extern void scm_remember_upto_here_1 (SCM obj);
+extern void scm_remember_upto_here_2 (SCM obj1, SCM obj2);
+extern void scm_remember_upto_here (SCM obj1, ...);
 extern SCM scm_return_first (SCM elt, ...);
 extern int scm_return_first_int (int x, ...);
 extern SCM scm_permanent_object (SCM obj);
@@ -370,6 +372,7 @@
 #define SCM_CLRGC8MARK(x) SCM_CLRGCMARK (x)
 #define SCM_GCTYP16(x) SCM_TYP16 (x)
 #define SCM_GCCDR(x) SCM_CDR (x)
+extern void scm_remember (SCM * ptr);
 
 #endif  /* SCM_DEBUG_DEPRECATED == 0 */
 
Index: guile/guile-core/libguile/gh_data.c
diff -u guile/guile-core/libguile/gh_data.c:1.48 
guile/guile-core/libguile/gh_data.c:1.49
--- guile/guile-core/libguile/gh_data.c:1.48    Fri Dec  8 09:08:34 2000
+++ guile/guile-core/libguile/gh_data.c Thu Dec 28 08:49:09 2000
@@ -122,7 +122,7 @@
   
   effective_length = ((unsigned) len < dst_len) ? len : dst_len;
   memmove (dst_ptr + start, src, effective_length);
-  scm_remember (&dst);
+  scm_remember_upto_here_1 (dst);
 }
 
 /* Return the symbol named SYMBOL_STR.  */
@@ -543,8 +543,7 @@
                                      "gh_scm2newstr");
   /* so we copy tmp_str to ret_str, which is what we will allocate */
   memcpy (ret_str, SCM_STRING_CHARS (str), len);
-  /* from now on we don't mind if str gets GC collected. */
-  scm_remember (&str);
+  scm_remember_upto_here_1 (str);
   /* now make sure we null-terminate it */
   ret_str[len] = '\0';
 
@@ -575,7 +574,7 @@
   effective_length = (len < src_len) ? len : src_len;
   memcpy (dst + start, SCM_STRING_CHARS (src), effective_length * sizeof 
(char));
   /* FIXME: must signal an error if len > src_len */
-  scm_remember (&src);
+  scm_remember_upto_here_1 (src);
 }
 
 
@@ -600,8 +599,7 @@
                                      "gh_symbol2newstr");
   /* so we copy sym to ret_str, which is what we will allocate */
   memcpy (ret_str, SCM_SYMBOL_CHARS (sym), len);
-  /* from now on we don't mind if sym gets GC collected. */
-  scm_remember (&sym);
+  scm_remember_upto_here_1 (sym);
   /* now make sure we null-terminate it */
   ret_str[len] = '\0';
 
Index: guile/guile-core/libguile/print.c
diff -u guile/guile-core/libguile/print.c:1.109 
guile/guile-core/libguile/print.c:1.110
--- guile/guile-core/libguile/print.c:1.109     Fri Dec  8 09:32:56 2000
+++ guile/guile-core/libguile/print.c   Thu Dec 28 08:49:09 2000
@@ -578,7 +578,7 @@
                  }
              if (pos < end)
                scm_lfwrite (str + pos, end - pos, port);
-             scm_remember (&exp);
+             scm_remember_upto_here_1 (exp);
              if (weird)
                scm_lfwrite ("}#", 2, port);
              break;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]