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, 23 Nov 2000 00:59:23 -0800

CVSROOT:        /cvs
Module name:    guile
Changes by:     Dirk Herrmann <address@hidden>  00/11/23 00:59:22

Modified files:
        guile-core     : NEWS RELEASE 
        guile-core/libguile: ChangeLog gc.c gh_data.c strings.c 
                             strings.h symbols.c symbols.h unif.c unif.h 

Log message:
        * Deprecated SCM_SETLENGTH.

CVSWeb URLs:
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/NEWS.diff?r1=1.217&r2=1.218
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/RELEASE.diff?r1=1.76&r2=1.77
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/ChangeLog.diff?r1=1.1172&r2=1.1173
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/gc.c.diff?r1=1.163&r2=1.164
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/gh_data.c.diff?r1=1.44&r2=1.45
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/strings.c.diff?r1=1.45&r2=1.46
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/strings.h.diff?r1=1.24&r2=1.25
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/symbols.c.diff?r1=1.65&r2=1.66
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/symbols.h.diff?r1=1.41&r2=1.42
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/unif.c.diff?r1=1.92&r2=1.93
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/unif.h.diff?r1=1.29&r2=1.30

Patches:
Index: guile/guile-core/NEWS
diff -u guile/guile-core/NEWS:1.217 guile/guile-core/NEWS:1.218
--- guile/guile-core/NEWS:1.217 Wed Nov 22 07:36:58 2000
+++ guile/guile-core/NEWS       Thu Nov 23 00:59:22 2000
@@ -243,7 +243,9 @@
 
 Use these instead of SCM_LENGTH.
 
-** New macros:  SCM_SET_CONTINUATION_LENGTH, SCM_SET_VECTOR_LENGTH
+** New macros:  SCM_SET_CONTINUATION_LENGTH, SCM_SET_STRING_LENGTH, 
+SCM_SET_SYMBOL_LENGTH, SCM_SET_VECTOR_LENGTH, SCM_SET_UVECTOR_LENGTH,
+SCM_SET_BITVECTOR_LENGTH
 
 Use these instead of SCM_SETLENGTH
 
@@ -268,7 +270,7 @@
 SCM_VALIDATE_NULLORROSTRING_COPY, SCM_ROLENGTH, SCM_LENGTH, SCM_HUGE_LENGTH,
 SCM_SUBSTRP, SCM_SUBSTR_STR, SCM_SUBSTR_OFFSET, SCM_COERCE_SUBSTR,
 SCM_ROSTRINGP, SCM_RWSTRINGP, SCM_VALIDATE_RWSTRING, SCM_ROCHARS,
-SCM_ROUCHARS
+SCM_ROUCHARS, SCM_SETLENGTH
 
 Use SCM_ASSERT_RANGE or SCM_VALIDATE_XXX_RANGE instead of SCM_OUTOFRANGE.
 Use scm_memory_error instead of SCM_NALLOC.
@@ -284,6 +286,7 @@
 Use SCM_VALIDATE_STRING instead of SCM_VALIDATE_RWSTRING.
 Use SCM_STRING_CHARS instead of SCM_ROCHARS.
 Use SCM_STRING_UCHARS instead of SCM_ROUCHARS.
+Use a type specific setter macro instead of SCM_SETLENGTH.
 
 ** Removed function:  scm_struct_init
 
Index: guile/guile-core/RELEASE
diff -u guile/guile-core/RELEASE:1.76 guile/guile-core/RELEASE:1.77
--- guile/guile-core/RELEASE:1.76       Wed Nov 22 03:20:02 2000
+++ guile/guile-core/RELEASE    Thu Nov 23 00:59:22 2000
@@ -50,7 +50,7 @@
   SCM_VALIDATE_ROSTRING_COPY, SCM_VALIDATE_NULLORROSTRING_COPY, SCM_ROLENGTH,
   SCM_LENGTH, SCM_HUGE_LENGTH, SCM_SUBSTRP, SCM_SUBSTR_STR, SCM_SUBSTR_OFFSET,
   SCM_COERCE_SUBSTR, SCM_ROSTRINGP, SCM_RWSTRINGP, SCM_VALIDATE_RWSTRING,
-  SCM_ROCHARS, SCM_ROUCHARS
+  SCM_ROCHARS, SCM_ROUCHARS, SCM_SETLENGTH
 - remove scm_vector_set_length_x
 - remove function scm_call_catching_errors
   (replaced by catch functions from throw.[ch])
Index: guile/guile-core/libguile/ChangeLog
diff -u guile/guile-core/libguile/ChangeLog:1.1172 
guile/guile-core/libguile/ChangeLog:1.1173
--- guile/guile-core/libguile/ChangeLog:1.1172  Wed Nov 22 07:36:58 2000
+++ guile/guile-core/libguile/ChangeLog Thu Nov 23 00:59:22 2000
@@ -1,5 +1,21 @@
 2000-11-22  Dirk Herrmann  <address@hidden>
 
+       * gc.c (scm_gc_sweep), unif.c (scm_make_uve):  Don't allocate or
+       free memory for empty bitvectors.
+
+       * gh_data.c (makvect), strings.c (scm_makstr, scm_take_str),
+       symbols.c (scm_intern_obarray_soft,
+       scm_sysintern0_no_module_lookup), unif.c (scm_make_uve):  Use
+       appropriate SCM_SET_<type>_LENGTH macro instead of SCM_SETLENGTH.
+
+       * strings.h (SCM_SET_STRING_LENGTH), symbols.h
+       (SCM_SET_SYMBOL_LENGTH), unif.h (SCM_SET_UVECTOR_LENGTH,
+       SCM_SET_BITVECTOR_LENGTH):  Added.
+
+       * symbols.h (SCM_SETLENGTH):  Deprecated.
+
+2000-11-22  Dirk Herrmann  <address@hidden>
+
        * continuations.c (scm_make_cont):  Use
        SCM_SET_CONTINUATION_LENGTH instead of SCM_SETLENGTH.
 
Index: guile/guile-core/libguile/gc.c
diff -u guile/guile-core/libguile/gc.c:1.163 
guile/guile-core/libguile/gc.c:1.164
--- guile/guile-core/libguile/gc.c:1.163        Fri Nov 17 08:25:03 2000
+++ guile/guile-core/libguile/gc.c      Thu Nov 23 00:59:22 2000
@@ -1621,8 +1621,14 @@
 #endif
 #ifdef HAVE_ARRAYS
            case scm_tc7_bvect:
-             m += sizeof (long) * ((SCM_BITVECTOR_LENGTH (scmptr) + 
SCM_LONG_BIT - 1) / SCM_LONG_BIT);
-             scm_must_free (SCM_BITVECTOR_BASE (scmptr));
+             {
+               unsigned long int length = SCM_BITVECTOR_LENGTH (scmptr);
+               if (length > 0)
+                 {
+                   m += sizeof (long) * ((length + SCM_LONG_BIT - 1) / 
SCM_LONG_BIT);
+                   scm_must_free (SCM_BITVECTOR_BASE (scmptr));
+                 }
+             }
              break;
            case scm_tc7_byvect:
            case scm_tc7_ivect:
Index: guile/guile-core/libguile/gh_data.c
diff -u guile/guile-core/libguile/gh_data.c:1.44 
guile/guile-core/libguile/gh_data.c:1.45
--- guile/guile-core/libguile/gh_data.c:1.44    Wed Nov 22 03:20:03 2000
+++ guile/guile-core/libguile/gh_data.c Thu Nov 23 00:59:22 2000
@@ -170,7 +170,7 @@
   SCM_NEWCELL (ans);
   SCM_DEFER_INTS;
   SCM_SETCHARS (ans, m);
-  SCM_SETLENGTH (ans, len, type);
+  SCM_SET_UVECTOR_LENGTH (ans, len, type);
   SCM_ALLOW_INTS;
   return ans;
 }
Index: guile/guile-core/libguile/strings.c
diff -u guile/guile-core/libguile/strings.c:1.45 
guile/guile-core/libguile/strings.c:1.46
--- guile/guile-core/libguile/strings.c:1.45    Wed Nov 22 03:20:03 2000
+++ guile/guile-core/libguile/strings.c Thu Nov 23 00:59:22 2000
@@ -133,7 +133,7 @@
   mem[len] = 0;
   SCM_NEWCELL (s);
   SCM_SETCHARS (s, mem);
-  SCM_SETLENGTH (s, len, scm_tc7_string);
+  SCM_SET_STRING_LENGTH (s, len);
 
   return s;
 }
@@ -168,7 +168,7 @@
   SCM answer;
   SCM_NEWCELL (answer);
   SCM_DEFER_INTS;
-  SCM_SETLENGTH (answer, len, scm_tc7_string);
+  SCM_SET_STRING_LENGTH (answer, len);
   scm_done_malloc (len + 1);
   SCM_SETCHARS (answer, s);
   SCM_ALLOW_INTS;
Index: guile/guile-core/libguile/strings.h
diff -u guile/guile-core/libguile/strings.h:1.24 
guile/guile-core/libguile/strings.h:1.25
--- guile/guile-core/libguile/strings.h:1.24    Wed Nov 22 03:20:03 2000
+++ guile/guile-core/libguile/strings.h Thu Nov 23 00:59:22 2000
@@ -57,6 +57,7 @@
 #define SCM_STRING_CHARS(x) ((char *) (SCM_CELL_WORD_1 (x)))
 #endif
 #define SCM_STRING_LENGTH(x) (((unsigned long) SCM_CELL_WORD_0 (x)) >> 8)
+#define SCM_SET_STRING_LENGTH(s, l) (SCM_SET_CELL_WORD_0 ((s), ((l) << 8) + 
scm_tc7_string))
 
 #define SCM_STRING_COERCE_0TERMINATION_X(x) \
   { if (SCM_NIMP (x) && (SCM_TYP7 (x) == scm_tc7_substring)) \
Index: guile/guile-core/libguile/symbols.c
diff -u guile/guile-core/libguile/symbols.c:1.65 
guile/guile-core/libguile/symbols.c:1.66
--- guile/guile-core/libguile/symbols.c:1.65    Wed Nov 22 03:20:03 2000
+++ guile/guile-core/libguile/symbols.c Thu Nov 23 00:59:22 2000
@@ -294,7 +294,7 @@
   SCM_SETCHARS (lsym, duplicate_string (name, len));
   SCM_SET_SYMBOL_HASH (lsym, raw_hash);
   SCM_SET_PROP_SLOTS (lsym, scm_cons (SCM_BOOL_F, SCM_EOL));
-  SCM_SETLENGTH (lsym, (long) len, scm_tc7_symbol);
+  SCM_SET_SYMBOL_LENGTH (lsym, (long) len);
 
   if (SCM_FALSEP (obarray))
     {
@@ -369,7 +369,7 @@
       SCM_SETCHARS (lsym, name);
       SCM_SET_SYMBOL_HASH (lsym, raw_hash);
       SCM_SET_PROP_SLOTS (lsym, scm_cons (SCM_BOOL_F, SCM_EOL));
-      SCM_SETLENGTH (lsym, (long) len, scm_tc7_symbol);
+      SCM_SET_SYMBOL_LENGTH (lsym, (long) len);
 
       lsym = scm_cons (lsym, SCM_UNDEFINED);
       SCM_VELTS (scm_symhash)[hash] = scm_cons (lsym, SCM_VELTS 
(scm_symhash)[hash]);
Index: guile/guile-core/libguile/symbols.h
diff -u guile/guile-core/libguile/symbols.h:1.41 
guile/guile-core/libguile/symbols.h:1.42
--- guile/guile-core/libguile/symbols.h:1.41    Wed Nov 22 03:20:03 2000
+++ guile/guile-core/libguile/symbols.h Thu Nov 23 00:59:22 2000
@@ -60,9 +60,9 @@
 #define SCM_SYMBOL_UCHARS(x)  ((unsigned char *) (SCM_CELL_WORD_1 (x)))
 #define SCM_SYMBOL_CHARS(x)  ((char *) (SCM_CELL_WORD_1 (x)))
 #define SCM_SYMBOL_LENGTH(x)  (((unsigned long) SCM_CELL_WORD_0 (x)) >> 8)
+#define SCM_SET_SYMBOL_LENGTH(s, l) (SCM_SET_CELL_WORD_0 ((s), ((l) << 8) + 
scm_tc7_symbol))
 
 #define SCM_LENGTH_MAX         (0xffffffL)
-#define SCM_SETLENGTH(x, v, t) (SCM_SET_CELL_WORD_0 ((x), ((v) << 8) + (t)))
 
 #define SCM_SETCHARS(x, v)     (SCM_SET_CELL_WORD_1 ((x), (scm_bits_t) (v)))
 
@@ -120,6 +120,7 @@
 #define SCM_SUBSTR_STR(x) (SCM_CDDR (x))
 #define SCM_SUBSTR_OFFSET(x) (SCM_CADR (x))
 #define SCM_LENGTH(x) (((unsigned long) SCM_CELL_WORD_0 (x)) >> 8)
+#define SCM_SETLENGTH(x, v, t) (SCM_SET_CELL_WORD_0 ((x), ((v) << 8) + (t)))
 #define SCM_ROSTRINGP(x) (SCM_NIMP(x) && ((SCM_TYP7S(x)==scm_tc7_string) \
                          || (SCM_TYP7(x) == scm_tc7_symbol)))
 #define SCM_ROLENGTH(x) SCM_LENGTH (x)
Index: guile/guile-core/libguile/unif.c
diff -u guile/guile-core/libguile/unif.c:1.92 
guile/guile-core/libguile/unif.c:1.93
--- guile/guile-core/libguile/unif.c:1.92       Fri Nov 17 08:25:04 2000
+++ guile/guile-core/libguile/unif.c    Thu Nov 23 00:59:22 2000
@@ -162,8 +162,19 @@
 
   if (SCM_EQ_P (prot, SCM_BOOL_T))
     {
-      i = sizeof (long) * ((k + SCM_LONG_BIT - 1) / SCM_LONG_BIT);
-      type = scm_tc7_bvect;
+      SCM_NEWCELL (v);
+      if (k > 0)
+       {
+         i = sizeof (long) * ((k + SCM_LONG_BIT - 1) / SCM_LONG_BIT);
+         SCM_SETCHARS (v, (char *) scm_must_malloc (i, "vector"));
+         SCM_SET_BITVECTOR_LENGTH (v, k);
+       }
+      else
+       {
+         SCM_SETCHARS (v, 0);
+         SCM_SET_BITVECTOR_LENGTH (v, 0);
+       }
+      return v;
     }
   else if (SCM_CHARP (prot) && (SCM_CHAR (prot) == '\0'))
     {
@@ -173,7 +184,7 @@
   else if (SCM_CHARP (prot))
     {
       i = sizeof (char) * k;
-      type = scm_tc7_string;
+      return scm_makstr (i, 0);
     }
   else if (SCM_INUMP (prot))
     {
@@ -229,7 +240,7 @@
   SCM_NEWCELL (v);
   SCM_DEFER_INTS;
   SCM_SETCHARS (v, (char *) scm_must_malloc (i ? i : 1, "vector"));
-  SCM_SETLENGTH (v, k, type);
+  SCM_SET_UVECTOR_LENGTH (v, k, type);
   SCM_ALLOW_INTS;
   return v;
 }
Index: guile/guile-core/libguile/unif.h
diff -u guile/guile-core/libguile/unif.h:1.29 
guile/guile-core/libguile/unif.h:1.30
--- guile/guile-core/libguile/unif.h:1.29       Mon Oct 30 03:42:26 2000
+++ guile/guile-core/libguile/unif.h    Thu Nov 23 00:59:22 2000
@@ -88,10 +88,12 @@
 
 #define SCM_UVECTOR_BASE(x) ((void *) (SCM_CELL_WORD_1 (x)))
 #define SCM_UVECTOR_LENGTH(x) (((unsigned long) SCM_CELL_WORD_0 (x)) >> 8)
+#define SCM_SET_UVECTOR_LENGTH(v, l, t) (SCM_SET_CELL_WORD_0 ((v), ((l) << 8) 
+ (t)))
 
 #define SCM_BITVECTOR_P(x) (!SCM_IMP (x) && (SCM_TYP7 (x) == scm_tc7_bvect))
 #define SCM_BITVECTOR_BASE(x) ((void *) (SCM_CELL_WORD_1 (x)))
 #define SCM_BITVECTOR_LENGTH(x) (((unsigned long) SCM_CELL_WORD_0 (x)) >> 8)
+#define SCM_SET_BITVECTOR_LENGTH(v, l) (SCM_SET_CELL_WORD_0 ((v), ((l) << 8) + 
scm_tc7_bvect))
 
 
 



reply via email to

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