summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@oblong.net>2009-03-17 16:04:04 +0100
committerAndy Wingo <wingo@oblong.net>2009-03-17 16:04:04 +0100
commit798e66ab10aba03ab98a070dbaef427e4cc1573f (patch)
tree21885e191faea8be699bc480e4616d987c03eb18
parent997eda2a30ff9235687cde508148d6456e982813 (diff)
parent04795a1cb259c20896fb2edb50c58086027281b0 (diff)
downloadguile-798e66ab10aba03ab98a070dbaef427e4cc1573f.tar.gz
Merge commit '04795a1cb259c20896fb2edb50c58086027281b0' into vm-check
-rw-r--r--libguile/goops.c3
-rw-r--r--libguile/goops.h4
-rw-r--r--libguile/smob.c6
3 files changed, 6 insertions, 7 deletions
diff --git a/libguile/goops.c b/libguile/goops.c
index 6e11ab528..340a9d05e 100644
--- a/libguile/goops.c
+++ b/libguile/goops.c
@@ -159,7 +159,7 @@ SCM scm_class_scm;
SCM scm_class_int, scm_class_float, scm_class_double;
SCM *scm_port_class = 0;
-SCM *scm_smob_class = 0;
+SCM scm_smob_class[SCM_I_MAX_SMOB_TYPE_COUNT];
SCM scm_no_applicable_method;
@@ -2727,7 +2727,6 @@ create_smob_classes (void)
{
long i;
- scm_smob_class = scm_malloc (SCM_I_MAX_SMOB_TYPE_COUNT * sizeof (SCM));
for (i = 0; i < SCM_I_MAX_SMOB_TYPE_COUNT; ++i)
scm_smob_class[i] = 0;
diff --git a/libguile/goops.h b/libguile/goops.h
index 4c05a4819..7ca276ff4 100644
--- a/libguile/goops.h
+++ b/libguile/goops.h
@@ -3,7 +3,7 @@
#ifndef SCM_GOOPS_H
#define SCM_GOOPS_H
-/* Copyright (C) 1998,1999,2000,2001,2002,2003, 2006, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 1998,1999,2000,2001,2002,2003, 2006, 2008, 2009 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -171,7 +171,7 @@ SCM_API SCM scm_class_integer;
SCM_API SCM scm_class_fraction;
SCM_API SCM scm_class_unknown;
SCM_API SCM *scm_port_class;
-SCM_API SCM *scm_smob_class;
+SCM_API SCM scm_smob_class[];
SCM_API SCM scm_class_top;
SCM_API SCM scm_class_object;
SCM_API SCM scm_class_class;
diff --git a/libguile/smob.c b/libguile/smob.c
index 2e781ed1e..899197901 100644
--- a/libguile/smob.c
+++ b/libguile/smob.c
@@ -309,7 +309,7 @@ scm_make_smob_type (char const *name, size_t size)
}
/* Make a class object if Goops is present. */
- if (scm_smob_class)
+ if (SCM_UNPACK (scm_smob_class[0]) != 0)
scm_smob_class[new_smob] = scm_make_extended_class (name, 0);
return scm_tc7_smob + new_smob * 256;
@@ -449,8 +449,8 @@ scm_set_smob_apply (scm_t_bits tc, SCM (*apply) (),
scm_smobs[SCM_TC2SMOBNUM (tc)].apply_2 = apply_2;
scm_smobs[SCM_TC2SMOBNUM (tc)].apply_3 = apply_3;
scm_smobs[SCM_TC2SMOBNUM (tc)].gsubr_type = type;
-
- if (scm_smob_class)
+
+ if (SCM_UNPACK (scm_smob_class[0]) != 0)
scm_i_inherit_applicable (scm_smob_class[SCM_TC2SMOBNUM (tc)]);
}