mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-14 15:40:19 +02:00
Publish the maximum number of SMOB types as `SCM_I_MAX_SMOB_TYPE_COUNT'.
* libguile/goops.c (create_smob_classes): Refer to `SCM_I_MAX_SMOB_TYPE_COUNT' rather than 255 (which is wrong) or 256. * libguile/smob.c (MAX_SMOB_COUNT): Alias for `SCM_I_MAX_SMOB_TYPE_COUNT'. * libguile/smob.h (SCM_I_MAX_SMOB_TYPE_COUNT): New macro.
This commit is contained in:
parent
d0cad2492c
commit
c891a40e9f
3 changed files with 9 additions and 5 deletions
|
@ -2697,8 +2697,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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue