diff options
Diffstat (limited to 'libguile/struct.c')
-rw-r--r-- | libguile/struct.c | 11 |
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); |