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: Wed, 25 Oct 2000 05:58:52 -0700

CVSROOT:        /cvs
Module name:    guile
Changes by:     Dirk Herrmann <address@hidden>  00/10/25 05:58:51

Modified files:
        guile-core     : NEWS RELEASE 
        guile-core/libguile: ChangeLog gc.c vectors.c vectors.h 

Log message:
        * Deprecated scm_vector_set_length_x.
        * Zero length vectors do not allocate dummy memory any more.

CVSWeb URLs:
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/NEWS.diff?r1=1.207&r2=1.208
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/RELEASE.diff?r1=1.71&r2=1.72
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/ChangeLog.diff?r1=1.1151&r2=1.1152
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/gc.c.diff?r1=1.160&r2=1.161
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/vectors.c.diff?r1=1.37&r2=1.38
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/vectors.h.diff?r1=1.23&r2=1.24

Patches:
Index: guile/guile-core/NEWS
diff -u guile/guile-core/NEWS:1.207 guile/guile-core/NEWS:1.208
--- guile/guile-core/NEWS:1.207 Wed Oct 25 04:01:03 2000
+++ guile/guile-core/NEWS       Wed Oct 25 05:58:51 2000
@@ -159,6 +159,10 @@
 
 Use scm_string_hash instead.
 
+** Deprecated function:  scm_vector_set_length_x
+
+Instead, create a fresh vector of the desired size and copy the contents.
+
 ** scm_gensym has changed prototype
 
 scm_gensym now only takes one argument.
Index: guile/guile-core/RELEASE
diff -u guile/guile-core/RELEASE:1.71 guile/guile-core/RELEASE:1.72
--- guile/guile-core/RELEASE:1.71       Wed Oct 25 04:01:03 2000
+++ guile/guile-core/RELEASE    Wed Oct 25 05:58:51 2000
@@ -47,6 +47,7 @@
   SCM_ALRM_SIGNAL, SCM_GC_SIGNAL, SCM_TICK_SIGNAL, SCM_SIG_ORD, 
   SCM_ORD_SIG, SCM_NUM_SIGS, SCM_SLOPPY_STRINGP, SCM_VALIDATE_STRINGORSUBSTR,
   SCM_FREEP, SCM_NFREEP
+- remove scm_vector_set_length_x
 - remove function scm_call_catching_errors
   (replaced by catch functions from throw.[ch])
 - remove support for "#&" reader syntax in (ice-9 optargs).
Index: guile/guile-core/libguile/ChangeLog
diff -u guile/guile-core/libguile/ChangeLog:1.1151 
guile/guile-core/libguile/ChangeLog:1.1152
--- guile/guile-core/libguile/ChangeLog:1.1151  Wed Oct 25 04:01:03 2000
+++ guile/guile-core/libguile/ChangeLog Wed Oct 25 05:58:51 2000
@@ -1,5 +1,16 @@
 2000-10-25  Dirk Herrmann  <address@hidden>
 
+       * gc.c (scm_igc):  Remove references to scm_vector_set_length_x.
+
+       (scm_gc_sweep):  SCM_CONTREGS is never NULL.
+
+       * gc.c (scm_gc_sweep), vectors.c (scm_make_vector):  Don't
+       allocate/free memory for zero length vectors.
+
+       * vectors.[ch] (scm_vector_set_length_x):  Deprecated.
+
+2000-10-25  Dirk Herrmann  <address@hidden>
+
        * alist.c (scm_assq_ref):  Add a suggestion about how to deal with
        this function when the API gets reviewed.
 
Index: guile/guile-core/libguile/gc.c
diff -u guile/guile-core/libguile/gc.c:1.160 
guile/guile-core/libguile/gc.c:1.161
--- guile/guile-core/libguile/gc.c:1.160        Wed Oct 25 04:01:03 2000
+++ guile/guile-core/libguile/gc.c      Wed Oct 25 05:58:51 2000
@@ -1025,14 +1025,7 @@
 
 #ifndef USE_THREADS
 
-  /* Protect from the C stack.  This must be the first marking
-   * done because it provides information about what objects
-   * are "in-use" by the C code.   "in-use" objects are  those
-   * for which the information about length and base address must
-   * remain usable.   This requirement is stricter than a liveness
-   * requirement -- in particular, it constrains the implementation
-   * of scm_vector_set_length_x.
-   */
+  /* Mark objects on the C stack. */
   SCM_FLUSH_REGISTER_WINDOWS;
   /* This assumes that all registers are saved into the jmp_buf */
   setjmp (scm_save_regs_gc_mark);
@@ -1057,10 +1050,6 @@
 
 #endif /* USE_THREADS */
 
-  /* FIXME: insert a phase to un-protect string-data preserved
-   * in scm_vector_set_length_x.
-   */
-
   j = SCM_NUM_PROTECTS;
   while (j--)
     scm_gc_mark (scm_sys_protects[j]);
@@ -1615,9 +1604,15 @@
               scm_must_free (SCM_VECTOR_BASE (scmptr) - 2);
               break;
            case scm_tc7_vector:
-             m += (SCM_VECTOR_LENGTH (scmptr) * sizeof (SCM));
-             scm_must_free (SCM_VECTOR_BASE (scmptr));
-             break;
+             {
+               unsigned long int length = SCM_VECTOR_LENGTH (scmptr);
+               if (length > 0)
+                 {
+                   m += length * sizeof (scm_bits_t);
+                   scm_must_free (SCM_VECTOR_BASE (scmptr));
+                 }
+               break;
+             }
 #ifdef CCLO
            case scm_tc7_cclo:
              m += (SCM_CCLO_LENGTH (scmptr) * sizeof (SCM));
@@ -1656,15 +1651,8 @@
            case scm_tc7_contin:
              m += SCM_CONTINUATION_LENGTH (scmptr) * sizeof (SCM_STACKITEM)
                   + sizeof (scm_contregs);
-             if (SCM_CONTREGS (scmptr))
-               {
-                 scm_must_free (SCM_CONTREGS (scmptr));
-                 break;
-               }
-             else
-               {
-                 continue;
-               }
+             scm_must_free (SCM_CONTREGS (scmptr));
+             break;
            case scm_tcs_subrs:
               /* the various "subrs" (primitives) are never freed */
              continue;
Index: guile/guile-core/libguile/vectors.c
diff -u guile/guile-core/libguile/vectors.c:1.37 
guile/guile-core/libguile/vectors.c:1.38
--- guile/guile-core/libguile/vectors.c:1.37    Tue Oct 10 02:22:31 2000
+++ guile/guile-core/libguile/vectors.c Wed Oct 25 05:58:51 2000
@@ -55,6 +55,12 @@
 #include "libguile/unif.h"
 
 
+#if (SCM_DEBUG_DEPRECATED == 0)
+
+/* The function scm_vector_set_length_x will disappear in the next release of
+ * guile.
+ */
+
 /* 
  * This complicates things too much if allowed on any array.
  * C code can safely call it on arrays known to be used in a single
@@ -129,6 +135,8 @@
   return vect;
 }
 
+#endif /* (SCM_DEBUG_DEPRECATED == 0) */
+
 SCM_DEFINE (scm_vector_p, "vector?", 1, 0, 0, 
            (SCM obj),
            "Returns @t{#t} if @var{obj} is a vector, otherwise returns @t{#f}. 
(r5rs)")
@@ -263,22 +271,32 @@
 #define FUNC_NAME s_scm_make_vector
 {
   SCM v;
-  register long i;
-  register long j;
-  register SCM *velts;
+  unsigned long int i;
+  scm_bits_t *velts;
 
-  SCM_VALIDATE_INUM_MIN (1,k,0);
-  if (SCM_UNBNDP(fill))
+  SCM_VALIDATE_INUM_MIN (1, k, 0);
+  if (SCM_UNBNDP (fill))
     fill = SCM_UNSPECIFIED;
-  i = SCM_INUM(k);
-  SCM_NEWCELL(v);
+
+  i = SCM_INUM (k);
+  SCM_NEWCELL (v);
+
+  velts = (i != 0)
+    ? scm_must_malloc (i * sizeof (scm_bits_t), FUNC_NAME)
+    : NULL;
+
   SCM_DEFER_INTS;
-  SCM_SETCHARS(v, scm_must_malloc(i?(long)(i*sizeof(SCM)):1L, FUNC_NAME));
-  velts = SCM_VELTS(v);
-  for (j = 0; j < i; ++j)
-    velts[j] = fill;
-  SCM_SETLENGTH(v, i, scm_tc7_vector);
+  {
+    unsigned long int j;
+
+    for (j = 0; j != i; ++j)
+      velts[j] = SCM_UNPACK (fill);
+
+    SCM_SETCHARS (v, velts);
+    SCM_SETLENGTH (v, i, scm_tc7_vector);
+  }
   SCM_ALLOW_INTS;
+
   return v;
 }
 #undef FUNC_NAME
@@ -390,8 +408,6 @@
 scm_init_vectors ()
 {
 #include "libguile/vectors.x"
-  /*
-    scm_make_subr (s_resizuve, scm_tc7_subr_2, scm_vector_set_length_x); */
 }
 
 
Index: guile/guile-core/libguile/vectors.h
diff -u guile/guile-core/libguile/vectors.h:1.23 
guile/guile-core/libguile/vectors.h:1.24
--- guile/guile-core/libguile/vectors.h:1.23    Fri Oct  6 06:35:58 2000
+++ guile/guile-core/libguile/vectors.h Wed Oct 25 05:58:51 2000
@@ -71,7 +71,6 @@
 
 
 
-extern SCM scm_vector_set_length_x (SCM vect, SCM len);
 extern SCM scm_vector_p (SCM x);
 extern SCM scm_vector_length (SCM v);
 extern SCM scm_vector (SCM l);
@@ -92,6 +91,7 @@
 #if (SCM_DEBUG_DEPRECATED == 0)
 
 #define SCM_NVECTORP(x) (!SCM_VECTORP (x))
+extern SCM scm_vector_set_length_x (SCM vect, SCM len);
 
 #endif  /* SCM_DEBUG_DEPRECATED == 0 */
 



reply via email to

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