summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Djurfeldt <djurfeldt@nada.kth.se>2002-02-21 01:00:41 +0000
committerMikael Djurfeldt <djurfeldt@nada.kth.se>2002-02-21 01:00:41 +0000
commitc709de7f982ee19843e162f1778705a002c513c4 (patch)
tree1a0d1611cd719ecf7fcda61680bdfcf8b40df5c5
parentb30366b6b99b89e0aeeb23a9ed6b5f076ece48eb (diff)
downloadguile-c709de7f982ee19843e162f1778705a002c513c4.tar.gz
* gc.c (scm_gc_sweep): Print an error message when aborting due to
underflowing scm_mallocated.
-rw-r--r--libguile/ChangeLog5
-rw-r--r--libguile/gc.c20
2 files changed, 18 insertions, 7 deletions
diff --git a/libguile/ChangeLog b/libguile/ChangeLog
index b46f0f98a..80943b34e 100644
--- a/libguile/ChangeLog
+++ b/libguile/ChangeLog
@@ -1,3 +1,8 @@
+2002-02-20 Mikael Djurfeldt <mdj@linnaeus>
+
+ * gc.c (scm_gc_sweep): Print an error message when aborting due to
+ underflowing scm_mallocated.
+
2002-02-14 Marius Vollmer <marius.vollmer@uni-dortmund.de>
* gc.h, gc.c (scm_must_malloc, scm_must_realloc, scm_must_strdup,
diff --git a/libguile/gc.c b/libguile/gc.c
index 82bc71e4e..3c901b0dd 100644
--- a/libguile/gc.c
+++ b/libguile/gc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc.
+/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2002 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1833,12 +1833,18 @@ scm_gc_sweep ()
scm_gc_yield -= scm_cells_allocated;
if (scm_mallocated < m)
- /* The byte count of allocated objects has underflowed. This is
- probably because you forgot to report the sizes of objects you
- have allocated, by calling scm_done_malloc or some such. When
- the GC freed them, it subtracted their size from
- scm_mallocated, which underflowed. */
- abort ();
+ {
+ /* The byte count of allocated objects has underflowed. This is
+ probably because you forgot to report the sizes of objects you
+ have allocated, by calling scm_done_malloc or some such. When
+ the GC freed them, it subtracted their size from
+ scm_mallocated, which underflowed. */
+ fprintf (stderr,
+ "scm_gc_sweep: Byte count of allocated objects has underflowed.\n"
+ "This is probably because the GC hasn't been correctly informed\n"
+ "about object sizes\n");
+ abort ();
+ }
scm_mallocated -= m;
scm_gc_malloc_collected = m;