summaryrefslogtreecommitdiff
path: root/libguile/goops.c
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2009-01-18 20:21:44 +0100
committerLudovic Courtès <ludo@gnu.org>2009-01-18 20:21:44 +0100
commit63385df2fdc2f9bc70804383f071f2fb74743a86 (patch)
tree90226f6c09f8c5fc0dba2bbeca65b0fbd3af218f /libguile/goops.c
parent0953b549464e5bf1433e7f0b8a49ac4b464c3c11 (diff)
downloadguile-63385df2fdc2f9bc70804383f071f2fb74743a86.tar.gz
GOOPS: Statically allocate the PORT class array.
* libguile/goops.c (scm_port_class): Statically allocate it. (create_port_classes): Don't use `scm_calloc ()'. * libguile/goops.h (scm_port_class): Update declaration. * libguile/ports.c (scm_make_port_type): When checking whether GOOPS is initialized, check whether the first element of SCM_PORT_CLASS is non-zero.
Diffstat (limited to 'libguile/goops.c')
-rw-r--r--libguile/goops.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libguile/goops.c b/libguile/goops.c
index 1c61d10ae..9ac9e9afa 100644
--- a/libguile/goops.c
+++ b/libguile/goops.c
@@ -152,7 +152,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;
@@ -2741,11 +2746,6 @@ create_port_classes (void)
{
long i;
- /* 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_port_class = scm_calloc (3 * SCM_I_MAX_PORT_TYPE_COUNT * sizeof (SCM));
-
for (i = 0; i < scm_numptob; ++i)
scm_make_port_classes (i, SCM_PTOBNAME (i));
}