[Gc] infinite loop since 6.3alpha5

Paolo Molaro lupus at debian.org
Sat Jun 5 10:37:05 PDT 2004


On 06/05/04 Paolo Molaro wrote:
> It looks like gc 6.3alpha5 introduced a bug.
> It was first found by running the mono testsuite, but a simple C program
> gives the same results:
> 
> #include <gc.h>
> 
> int main ()
> {
>     void *p1 = GC_malloc (30000000 * 2);
>     void *p2 = GC_malloc (6000014);
> }

This fixes it, though I guess it may have some performance
implications.

--- alloc.c.old	2004-06-05 19:33:50.000000000 +0200
+++ alloc.c	2004-06-05 19:33:57.000000000 +0200
@@ -235,8 +235,7 @@
 /* Have we allocated enough to amortize a collection? */
 GC_bool GC_should_collect()
 {
-    return(GC_adj_words_allocd() >= min_words_allocd()
-	   || GC_heapsize >= GC_collect_at_heapsize);
+    return(GC_adj_words_allocd() >= min_words_allocd());
 }

lupus

-- 
-----------------------------------------------------------------
lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better


More information about the Gc mailing list