summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirk Herrmann <dirk@dirk-herrmanns-seiten.de>2000-06-30 13:48:28 +0000
committerDirk Herrmann <dirk@dirk-herrmanns-seiten.de>2000-06-30 13:48:28 +0000
commitc73879189d82d0a12ebdb077dfaa86e0849fa39f (patch)
treed702202a8f9c0ddee7f30cebf6e057a0cdb79df5
parent685c0d7116658bcefa6404224832480e1e6cba92 (diff)
downloadguile-c73879189d82d0a12ebdb077dfaa86e0849fa39f.tar.gz
* Improved memory error handling.
* Made the behaviour of scm_gc_for_newcell more obvious.
-rw-r--r--libguile/ChangeLog9
-rw-r--r--libguile/gc.c18
2 files changed, 24 insertions, 3 deletions
diff --git a/libguile/ChangeLog b/libguile/ChangeLog
index daeabdc4b..7dda5afbd 100644
--- a/libguile/ChangeLog
+++ b/libguile/ChangeLog
@@ -1,5 +1,14 @@
2000-06-30 Dirk Herrmann <D.Herrmann@tu-bs.de>
+ * 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 <D.Herrmann@tu-bs.de>
+
* __scm.h (SCM_OUTOFRANGE): Removed.
* error.c (scm_wta): Removed sick dispatch code for range
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