guile-cvs
[Top][All Lists]
Advanced

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

guile/guile-core/libguile ChangeLog chars.c gc....


From: Dirk Herrmann
Subject: guile/guile-core/libguile ChangeLog chars.c gc....
Date: Mon, 04 Dec 2000 09:19:36 -0800

CVSROOT:        /cvs
Module name:    guile
Changes by:     Dirk Herrmann <address@hidden>  00/12/04 09:19:35

Modified files:
        guile-core/libguile: ChangeLog chars.c gc.c procprop.c 

Log message:
        * Minor cleanup/optimization for char=?.
        * Cleanup CCLO handling.

CVSWeb URLs:
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/ChangeLog.diff?r1=1.1185&r2=1.1186
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/chars.c.diff?r1=1.26&r2=1.27
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/gc.c.diff?r1=1.165&r2=1.166
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/procprop.c.diff?r1=1.31&r2=1.32

Patches:
Index: guile/guile-core/libguile/ChangeLog
diff -u guile/guile-core/libguile/ChangeLog:1.1185 
guile/guile-core/libguile/ChangeLog:1.1186
--- guile/guile-core/libguile/ChangeLog:1.1185  Mon Dec  4 08:31:03 2000
+++ guile/guile-core/libguile/ChangeLog Mon Dec  4 09:19:35 2000
@@ -1,5 +1,14 @@
 2000-12-04  Dirk Herrmann  <address@hidden>
 
+       * chars.c (scm_char_eq_p):  Minor cleanup/optimization.
+
+       * gc.c (scm_gc_mark):  Don't use SCM_VELTS for CCLOs.
+
+       * procprop.c (scm_i_procedure_arity):  Separate handling of smobs
+       and CCLOs.
+
+2000-12-04  Dirk Herrmann  <address@hidden>
+
        * tags.h (scm_tc_free_cell, scm_tc16_big, scm_tc16_real,
        scm_tc16_complex):  Eliminate hard-coded value of scm_tc7_smob.
 
Index: guile/guile-core/libguile/chars.c
diff -u guile/guile-core/libguile/chars.c:1.26 
guile/guile-core/libguile/chars.c:1.27
--- guile/guile-core/libguile/chars.c:1.26      Fri Nov 17 08:25:03 2000
+++ guile/guile-core/libguile/chars.c   Mon Dec  4 09:19:35 2000
@@ -66,9 +66,9 @@
             "Return @code{#t} iff @var{x} is the same character as @var{y}, 
else @code{#f}.")
 #define FUNC_NAME s_scm_char_eq_p
 {
-  SCM_VALIDATE_CHAR (1,x);
-  SCM_VALIDATE_CHAR (2,y);
-  return SCM_BOOL(SCM_CHAR(x) == SCM_CHAR(y));
+  SCM_VALIDATE_CHAR (1, x);
+  SCM_VALIDATE_CHAR (2, y);
+  return SCM_BOOL (SCM_EQ_P (x, y));
 }
 #undef FUNC_NAME
 
Index: guile/guile-core/libguile/gc.c
diff -u guile/guile-core/libguile/gc.c:1.165 
guile/guile-core/libguile/gc.c:1.166
--- guile/guile-core/libguile/gc.c:1.165        Sat Nov 25 08:58:25 2000
+++ guile/guile-core/libguile/gc.c      Mon Dec  4 09:19:35 2000
@@ -1212,14 +1212,18 @@
       goto gc_mark_loop;
 #ifdef CCLO
     case scm_tc7_cclo:
-      i = SCM_CCLO_LENGTH (ptr);
-      if (i == 0)
-       break;
-      while (--i > 0)
-       if (SCM_NIMP (SCM_VELTS (ptr)[i]))
-         scm_gc_mark (SCM_VELTS (ptr)[i]);
-      ptr = SCM_VELTS (ptr)[0];
-      goto gc_mark_loop;
+      {
+       unsigned long int i = SCM_CCLO_LENGTH (ptr);
+       unsigned long int j;
+       for (j = 1; j != i; ++j)
+         {
+           SCM obj = SCM_CCLO_REF (ptr, j);
+           if (!SCM_IMP (obj))
+             scm_gc_mark (obj);
+         }
+       ptr = SCM_CCLO_REF (ptr, 0);
+       goto gc_mark_loop;
+      }
 #endif
 #ifdef HAVE_ARRAYS
     case scm_tc7_bvect:
Index: guile/guile-core/libguile/procprop.c
diff -u guile/guile-core/libguile/procprop.c:1.31 
guile/guile-core/libguile/procprop.c:1.32
--- guile/guile-core/libguile/procprop.c:1.31   Sat Nov 25 08:58:25 2000
+++ guile/guile-core/libguile/procprop.c        Mon Dec  4 09:19:35 2000
@@ -98,26 +98,33 @@
       r = 1;
       break;
     case scm_tc7_smob:
-      {
-       int type;
-       if (!SCM_SMOB_DESCRIPTOR (proc).apply)
+      if (SCM_SMOB_DESCRIPTOR (proc).apply)
+       {
+         int type = SCM_SMOB_DESCRIPTOR (proc).gsubr_type;
+         a += SCM_GSUBR_REQ (type);
+         o = SCM_GSUBR_OPT (type);
+         r = SCM_GSUBR_REST (type);
+         break;
+       }
+      else
+       {
          return SCM_BOOL_F;
-       type = SCM_SMOB_DESCRIPTOR (proc).gsubr_type;
-       goto gsubr_type;
-      case scm_tc7_cclo:
-       if (SCM_EQ_P (SCM_CCLO_SUBR (proc), scm_f_gsubr_apply))
+       }
+    case scm_tc7_cclo:
+      if (SCM_EQ_P (SCM_CCLO_SUBR (proc), scm_f_gsubr_apply))
        {
-         type = SCM_INUM (SCM_GSUBR_TYPE (proc));
-       gsubr_type:
+         int type = SCM_INUM (SCM_GSUBR_TYPE (proc));
          a += SCM_GSUBR_REQ (type);
          o = SCM_GSUBR_OPT (type);
          r = SCM_GSUBR_REST (type);
          break;
+       }
+      else
+       {
+         proc = SCM_CCLO_SUBR (proc);
+         a -= 1;
+         goto loop;
        }
-       proc = SCM_CCLO_SUBR (proc);
-       a -= 1;
-       goto loop;
-      }
     case scm_tc7_pws:
       proc = SCM_PROCEDURE (proc);
       goto loop;



reply via email to

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