diff --git a/libguile/ChangeLog b/libguile/ChangeLog index daeabdc4b..7dda5afbd 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,12 @@ +2000-06-30 Dirk Herrmann + + * gc.c (alloc_some_heap): Use scm_memory_error to indicate a + failed attempt to get additional memory from the system. + + (scm_gc_for_newcell): Changed the control structure to make the + behaviour explicit for the case that gc is not able to free any + cells. + 2000-06-30 Dirk Herrmann * __scm.h (SCM_OUTOFRANGE): Removed. diff --git a/libguile/gc.c b/libguile/gc.c index eca4c2f4e..075b28194 100644 --- a/libguile/gc.c +++ b/libguile/gc.c @@ -698,7 +698,7 @@ scm_gc_for_newcell (scm_freelist_t *master, SCM *freelist) ++scm_ints_disabled; do { - while (SCM_NULLP (master->clusters)) + if (SCM_NULLP (master->clusters)) { if (master->grow_heap_p || scm_block_gc) { @@ -715,6 +715,12 @@ scm_gc_for_newcell (scm_freelist_t *master, SCM *freelist) #endif scm_igc ("cells"); adjust_min_yield (master); + if (SCM_NULLP (master->clusters)) + { + /* gc could not free any cells */ + master->grow_heap_p = 0; + alloc_some_heap (master); + } } } cell = SCM_CAR (master->clusters); @@ -1962,7 +1968,10 @@ alloc_some_heap (scm_freelist_t *freelist) SCM_SYSCALL (tmptable = ((scm_heap_seg_data_t *) realloc ((char *)scm_heap_table, len))); if (!tmptable) - SCM_MISC_ERROR ("could not grow heap segment table", SCM_EOL); + /* Dirk:FIXME:: scm_memory_error needs an additional message parameter. + * Here: "could not grow heap segment table". + */ + scm_memory_error (FUNC_NAME); else scm_heap_table = tmptable; @@ -2025,7 +2034,10 @@ alloc_some_heap (scm_freelist_t *freelist) } } - SCM_MISC_ERROR ("could not grow heap", SCM_EOL); + /* Dirk:FIXME:: scm_memory_error needs an additional message parameter. + * Here: "could not grow heap". + */ + scm_memory_error (FUNC_NAME); } #undef FUNC_NAME