summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@oblong.net>2009-03-17 16:01:35 +0100
committerAndy Wingo <wingo@oblong.net>2009-03-17 16:01:35 +0100
commit997eda2a30ff9235687cde508148d6456e982813 (patch)
tree3480627517c8a051c0c9f3ffadf8e13a5a625170
parenta3f2bf81d9a1a8d080dd4b09d59c46995cefb1eb (diff)
parent202271f291971cf14175f5a1a193955f72d43d79 (diff)
downloadguile-997eda2a30ff9235687cde508148d6456e982813.tar.gz
Merge commit '202271f291971cf14175f5a1a193955f72d43d79' into vm-check
-rw-r--r--libguile/goops.c4
-rw-r--r--libguile/smob.c5
-rw-r--r--libguile/smob.h5
3 files changed, 9 insertions, 5 deletions
diff --git a/libguile/goops.c b/libguile/goops.c
index e207e9e33..6e11ab528 100644
--- a/libguile/goops.c
+++ b/libguile/goops.c
@@ -2727,8 +2727,8 @@ create_smob_classes (void)
{
long i;
- scm_smob_class = (SCM *) scm_malloc (255 * sizeof (SCM));
- for (i = 0; i < 255; ++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;
scm_smob_class[SCM_TC2SMOBNUM (scm_tc16_keyword)] = scm_class_keyword;
diff --git a/libguile/smob.c b/libguile/smob.c
index cbbc24e27..2e781ed1e 100644
--- a/libguile/smob.c
+++ b/libguile/smob.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1996,1998,1999,2000,2001, 2003, 2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1995,1996,1998,1999,2000,2001, 2003, 2004, 2006, 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
@@ -45,7 +45,8 @@
* tags for smobjects (if you know a tag you can get an index and conversely).
*/
-#define MAX_SMOB_COUNT 256
+#define MAX_SMOB_COUNT SCM_I_MAX_SMOB_TYPE_COUNT
+
long scm_numsmob;
scm_smob_descriptor scm_smobs[MAX_SMOB_COUNT];
diff --git a/libguile/smob.h b/libguile/smob.h
index a4d70c8be..7aab3e74f 100644
--- a/libguile/smob.h
+++ b/libguile/smob.h
@@ -3,7 +3,7 @@
#ifndef SCM_SMOB_H
#define SCM_SMOB_H
-/* Copyright (C) 1995,1996,1998,1999,2000,2001, 2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1995,1996,1998,1999,2000,2001, 2004, 2006, 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
@@ -112,6 +112,9 @@ do { \
#define SCM_SMOB_APPLY_2(x, a1, a2) (SCM_SMOB_DESCRIPTOR (x).apply_2 (x, (a1), (a2)))
#define SCM_SMOB_APPLY_3(x, a1, a2, rst) (SCM_SMOB_DESCRIPTOR (x).apply_3 (x, (a1), (a2), (rst)))
+/* Maximum number of SMOB types. */
+#define SCM_I_MAX_SMOB_TYPE_COUNT 256
+
SCM_API long scm_numsmob;
SCM_API scm_smob_descriptor scm_smobs[];