summaryrefslogtreecommitdiff
path: root/libguile/struct.c
diff options
context:
space:
mode:
authorMikael Djurfeldt <djurfeldt@nada.kth.se>2003-02-24 19:21:56 +0000
committerMikael Djurfeldt <djurfeldt@nada.kth.se>2003-02-24 19:21:56 +0000
commitb4a1358cfb3419e564c8670537440ef1fd9aa8e7 (patch)
tree1e0880cf8c6f86b063a3eb892775f7edba9fd70b /libguile/struct.c
parent53af82552221de939d0fe7de06e49ac6e18506a2 (diff)
downloadguile-b4a1358cfb3419e564c8670537440ef1fd9aa8e7.tar.gz
* struct.c (scm_struct_prehistory): Init scm_i_structs_to_free to
SCM_EOL. (scm_struct_prehistory): Move scm_free_structs to scm_before_mark_c_hook. * gc-card.c (sweep_card): Check that we haven't swept structs on this card before. That can happen if scm_i_sweep_all_segments has been called from some other place than scm_igc.
Diffstat (limited to 'libguile/struct.c')
-rw-r--r--libguile/struct.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/libguile/struct.c b/libguile/struct.c
index eb2c15cbf..94b431853 100644
--- a/libguile/struct.c
+++ b/libguile/struct.c
@@ -356,6 +356,15 @@ scm_struct_free_entity (scm_t_bits * vtable SCM_UNUSED, scm_t_bits * data)
}
static void *
+scm_struct_gc_init (void *dummy1 SCM_UNUSED,
+ void *dummy2 SCM_UNUSED,
+ void *dummy3 SCM_UNUSED)
+{
+ scm_i_structs_to_free = SCM_EOL;
+ return 0;
+}
+
+static void *
scm_free_structs (void *dummy1 SCM_UNUSED,
void *dummy2 SCM_UNUSED,
void *dummy3 SCM_UNUSED)
@@ -399,7 +408,6 @@ scm_free_structs (void *dummy1 SCM_UNUSED,
}
}
while (!SCM_NULLP (newchain));
- scm_i_structs_to_free = SCM_EOL;
return 0;
}
@@ -797,6 +805,7 @@ void
scm_struct_prehistory ()
{
scm_i_structs_to_free = SCM_EOL;
+ scm_c_hook_add (&scm_before_sweep_c_hook, scm_struct_gc_init, 0, 0);
/* With the new lazy sweep GC, the point at which the entire heap is
swept is just before the mark phase. */
scm_c_hook_add (&scm_before_mark_c_hook, scm_free_structs, 0, 0);