summaryrefslogtreecommitdiff
path: root/libguile/gc-freelist.c
diff options
context:
space:
mode:
Diffstat (limited to 'libguile/gc-freelist.c')
-rw-r--r--libguile/gc-freelist.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libguile/gc-freelist.c b/libguile/gc-freelist.c
index b3b558257..83c20f867 100644
--- a/libguile/gc-freelist.c
+++ b/libguile/gc-freelist.c
@@ -72,14 +72,13 @@ SCM_DEFINE (scm_gc_set_debug_check_freelist_x, "gc-set-debug-check-freelist!", 1
-/*
- This adjust FREELIST variables to decide wether or not to allocate
- more heap in the next GC run. It uses scm_gc_cells_collected and scm_gc_cells_collected1
- */
-
+/* Adjust FREELIST variables to decide wether or not to allocate more heap in
+ the next GC run based on SWEEP_STATS on SWEEP_STATS_1 (statistics
+ collected after the two last full GC). */
void
scm_i_adjust_min_yield (scm_t_cell_type_statistics *freelist,
- scm_t_sweep_statistics sweep_stats)
+ scm_t_sweep_statistics sweep_stats,
+ scm_t_sweep_statistics sweep_stats_1)
{
/* min yield is adjusted upwards so that next predicted total yield
* (allocated cells actually freed by GC) becomes
@@ -99,7 +98,8 @@ scm_i_adjust_min_yield (scm_t_cell_type_statistics *freelist,
{
/* Pick largest of last two yields. */
long delta = ((SCM_HEAP_SIZE * freelist->min_yield_fraction / 100)
- - (long) sweep_stats.collected);
+ - (long) SCM_MAX (sweep_stats.collected,
+ sweep_stats_1.collected));
#ifdef DEBUGINFO
fprintf (stderr, " after GC = %lu, delta = %ld\n",
(unsigned long) scm_cells_allocated,