summaryrefslogtreecommitdiff
path: root/libguile/goops.c
diff options
context:
space:
mode:
Diffstat (limited to 'libguile/goops.c')
-rw-r--r--libguile/goops.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/libguile/goops.c b/libguile/goops.c
index 4e6458697..520b1c25d 100644
--- a/libguile/goops.c
+++ b/libguile/goops.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998,1999,2000,2001,2002,2003,2004,2008
+/* Copyright (C) 1998,1999,2000,2001,2002,2003,2004,2008,2009
* Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
@@ -742,9 +742,8 @@ SCM_DEFINE (scm_sys_inherit_magic_x, "%inherit-magic!", 2, 0, 0,
ls = SCM_CDR (ls);
}
flags &= SCM_CLASSF_INHERIT;
- if (flags & SCM_CLASSF_ENTITY)
- SCM_SET_CLASS_DESTRUCTOR (class, scm_struct_free_entity);
- else
+
+ if (! (flags & SCM_CLASSF_ENTITY))
{
long n = SCM_I_INUM (SCM_SLOT (class, scm_si_nfields));
#if 0
@@ -761,7 +760,6 @@ SCM_DEFINE (scm_sys_inherit_magic_x, "%inherit-magic!", 2, 0, 0,
{
/* NOTE: The following depends on scm_struct_i_size. */
flags |= SCM_STRUCTF_LIGHT + n * sizeof (SCM); /* use light representation */
- SCM_SET_CLASS_DESTRUCTOR (class, scm_struct_free_light);
}
}
SCM_SET_CLASS_FLAGS (class, flags);
@@ -1886,6 +1884,11 @@ typedef struct t_extension {
SCM extension;
} t_extension;
+
+/* Hint for `scm_gc_malloc ()' et al. when allocating `t_extension'
+ objects. */
+static const char extension_gc_hint[] = "GOOPS extension";
+
static t_extension *extensions = 0;
SCM_VARIABLE (scm_var_make_extended_generic, "make-extended-generic");
@@ -1906,7 +1909,8 @@ scm_c_extend_primitive_generic (SCM extended, SCM extension)
}
else
{
- t_extension *e = scm_malloc (sizeof (t_extension));
+ t_extension *e = scm_gc_malloc (sizeof (t_extension),
+ extension_gc_hint);
t_extension **loc = &extensions;
/* Make sure that extensions are placed before their own
* extensions in the extensions list. O(N^2) algorithm, but
@@ -1929,7 +1933,6 @@ setup_extended_primitive_generics ()
t_extension *e = extensions;
scm_c_extend_primitive_generic (e->extended, e->extension);
extensions = e->next;
- free (e);
}
}
@@ -2819,7 +2822,6 @@ scm_make_class (SCM meta, char *s_name, SCM supers, size_t size,
}
else if (size > 0)
{
- SCM_SET_CLASS_DESTRUCTOR (class, scm_struct_free_light);
SCM_SET_CLASS_INSTANCE_SIZE (class, size);
}