mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-23 03:54:12 +02:00
* gc.c, gc.h, pairs.h, init.c: Implementation of a new way of
allocating heap. The basic idea is to trigger GC every Nth allocated cell and grow heap when free list runs out. The scheme has been extended so that GC isn't triggered until all remaining cells are used. The implementation is also prepared for development in the direction of POSIX threads. * gc.c (SCM_EXPHEAP): In order to grow by a factor of 1.5, SCM_EXPHEAP should return half of the heap size.
This commit is contained in:
parent
83c4c29dcb
commit
4a4c9785e0
4 changed files with 376 additions and 19 deletions
|
@ -474,9 +474,19 @@ scm_boot_guile_1 (SCM_STACKITEM *base, struct main_func_closure *closure)
|
|||
scm_ports_prehistory ();
|
||||
scm_smob_prehistory ();
|
||||
scm_tables_prehistory ();
|
||||
#if GUILE_DEBUG
|
||||
scm_init_storage (scm_i_getenv_int ("GUILE_INIT_HEAP_SIZE", 0),
|
||||
scm_i_getenv_int ("GUILE_INIT_HEAP_SIZE2", 0));
|
||||
#if defined (GUILE_DEBUG) && defined (GUILE_NEW_GC_SCHEME)
|
||||
{
|
||||
int gc_trigger = scm_i_getenv_int ("GUILE_GC_TRIGGER", 0);
|
||||
int gc_trigger2 = scm_i_getenv_int ("GUILE_GC_TRIGGER2", 0);
|
||||
scm_init_storage (scm_i_getenv_int ("GUILE_INIT_HEAP_SIZE", 0),
|
||||
/* default: trigger */
|
||||
gc_trigger >= 0 ? 1 : 0,
|
||||
gc_trigger < 0 ? - gc_trigger : gc_trigger,
|
||||
scm_i_getenv_int ("GUILE_INIT_HEAP_SIZE2", 40000),
|
||||
/* default: don't trigger GC */
|
||||
gc_trigger2 > 0 ? 1 : 0,
|
||||
gc_trigger2 < 0 ? - gc_trigger2 : gc_trigger2);
|
||||
}
|
||||
#else
|
||||
scm_init_storage (0, 0);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue