This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
gc suggestions
- To: Guile Mailing List <guile at sourceware dot cygnus dot com>
- Subject: gc suggestions
- From: Dirk Herrmann <dirk at ida dot ing dot tu-bs dot de>
- Date: Tue, 27 Jun 2000 13:17:30 +0200 (MEST)
Hello list.
I have the following suggestions for changes to the gc:
Problem:
The variable scm_gc_heap_lock blocks, if non-zero, the creation of new
heap segments, except for the very first heap segment, which is created
independently. This variable is initialized to zero, which means, that
even during the startup phase of guile new heap segments could be
potentially added, for example if the initial heap segment appears to be
too small.
The disadvantage of this behaviour is, that all initializations, which
are needed before the first gc is performed, have to be done very early
in scm_init_storage. This leads to the situation that some
initializations which would better fit into async.c are performed in
gc.c, since the implementation of the gc relies on asyncs being
initialized.
Thus:
I suggest to initialize scm_gc_heap_lock with 1 until scm_init_gc is
performed. Then, we just have to make sure that all initialization code
that scm_init_gc depends on is performed before in init.c. Thus, we
achieve the following goals:
- the initialization of the asyncs is performed at the right place.
- if the initial heap segment appears to be too small to be suffifient
until scm_init_gc is performed, guile aborts and can be fixed in order
to enlarge the initial heap segment.
i. e.:
* If set, don't expand the heap. Set only during gc, during which no allocation
* is supposed to take place anyway.
*/
-int scm_gc_heap_lock = 0;
+int scm_gc_heap_lock = 1;
/* GC Blocking
* Don't pause for collection if this is set -- just
(the comment should be updated also) and
scm_init_gc ()
{
scm_after_gc_hook = scm_create_hook ("after-gc-hook", 0);
+ scm_gc_heap_lock = 0;
#include "libguile/gc.x"
}
Best regards
Dirk