]> gitweb.factorcode.org Git - factor.git/commitdiff
Fix GC crash with -generations=2
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Tue, 9 Dec 2008 22:26:30 +0000 (16:26 -0600)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Tue, 9 Dec 2008 22:26:30 +0000 (16:26 -0600)
vm/code_heap.c
vm/data_gc.c
vm/data_gc.h

index 6ed5ea43095574c53287202c81cecf174bd3f0e2..9a1c45c7df9e90c287f96ea56ba70c9757331b92 100755 (executable)
@@ -147,6 +147,8 @@ void apply_relocation(CELL class, CELL offset, F_FIXNUM absolute_value)
 /* Perform all fixups on a code block */
 void relocate_code_block(F_COMPILED *compiled, CELL code_start, CELL literals_start)
 {
+       compiled->last_scan = NURSERY;
+
        if(compiled->relocation != F)
        {
                F_BYTE_ARRAY *relocation = untag_object(compiled->relocation);
index 6e15718b2d9604252ca9e2ea89d9f1fb77da7320..2122f930f0569e4f4be826812d3f1dd498f09f84 100755 (executable)
@@ -32,9 +32,7 @@ F_DATA_HEAP *alloc_data_heap(CELL gens,
        data_heap->gen_count = gens;
 
        CELL total_size;
-       if(data_heap->gen_count == 1)
-               total_size = 2 * tenured_size;
-       else if(data_heap->gen_count == 2)
+       if(data_heap->gen_count == 2)
                total_size = young_size + 2 * tenured_size;
        else if(data_heap->gen_count == 3)
                total_size = young_size + 2 * aging_size + 2 * tenured_size;
index 4ec3fdd5f2be752ed84bb41924ad756b3ee4acc7..6d367a25fda9fc3cef1314194507fe68678abc4e 100755 (executable)
@@ -137,6 +137,7 @@ void collect_cards(void);
 /* the oldest generation */
 #define TENURED (data_heap->gen_count-1)
 
+#define MIN_GEN_COUNT 1
 #define MAX_GEN_COUNT 3
 
 /* used during garbage collection only */