Merge commit 'feccd2d3100fd2964d4c2df58ab3da7ce4949a66' into vm-check
[bpt/guile.git] / libguile / goops.c
index 340a9d0..2fc6c31 100644 (file)
@@ -158,7 +158,12 @@ SCM scm_class_protected_opaque, scm_class_protected_read_only;
 SCM scm_class_scm;
 SCM scm_class_int, scm_class_float, scm_class_double;
 
-SCM *scm_port_class = 0;
+/* Port classes.  Allocate 3 times the maximum number of port types so that
+   input ports, output ports, and in/out ports can be stored at different
+   offsets.  See `SCM_IN_PCLASS_INDEX' et al.  */
+SCM scm_port_class[3 * SCM_I_MAX_PORT_TYPE_COUNT];
+
+/* SMOB classes.  */
 SCM scm_smob_class[SCM_I_MAX_SMOB_TYPE_COUNT];
 
 SCM scm_no_applicable_method;
@@ -1900,7 +1905,7 @@ scm_c_extend_primitive_generic (SCM extended, SCM extension)
       gext = scm_call_2 (SCM_VARIABLE_REF (scm_var_make_extended_generic),
                         gf,
                         SCM_SNAME (extension));
-      *SCM_SUBR_GENERIC (extension) = gext;
+      SCM_SET_SUBR_GENERIC (extension, gext);
     }
   else
     {
@@ -2771,10 +2776,6 @@ create_port_classes (void)
 {
   long i;
 
-  scm_port_class = (SCM *) scm_malloc (3 * 256 * sizeof (SCM));
-  for (i = 0; i < 3 * 256; ++i)
-    scm_port_class[i] = 0;
-
   for (i = 0; i < scm_numptob; ++i)
     scm_make_port_classes (i, SCM_PTOBNAME (i));
 }