Branch: Tag:

2003-09-08

2003-09-08 15:27:58 by Martin Stjernholm <mast@lysator.liu.se>

Added more tracking in the gc to help track down bugs when the gc follows
munged pointers in the mark pass. Activated with GC_MARK_DEBUG.

Rev: src/array.c:1.109
Rev: src/gc.c:1.155
Rev: src/gc.h:1.77
Rev: src/mapping.c:1.127
Rev: src/object.c:1.166
Rev: src/program.c:1.319
Rev: src/svalue.c:1.107

25:   #include "stuff.h"   #include "bignum.h"    - RCSID("$Id: array.c,v 1.108 2003/01/29 15:55:24 mast Exp $"); + RCSID("$Id: array.c,v 1.109 2003/09/08 15:27:57 mast Exp $");      PMOD_EXPORT struct array empty_array=   {
2053:   #endif    t = 0;    for(e=0;e<a->size;e++) -  if (!gc_mark_weak_svalues(a->item+e, 1)) { +  if (!debug_gc_mark_weak_svalues(a->item+e, 1, T_ARRAY, a)) {    a->item[d++]=a->item[e];    t |= 1 << a->item[e].type;    }    a->size=d;    }    else -  if (!(t = gc_mark_weak_svalues(a->item, a->size))) +  if (!(t = debug_gc_mark_weak_svalues(a->item, a->size, T_ARRAY, a)))    t = a->type_field;       /* Ugly, but we are not allowed to change type_field
2076:    }    else {    TYPE_FIELD t; -  if ((t = gc_mark_svalues(ITEM(a), a->size))) { +  if ((t = debug_gc_mark_svalues(ITEM(a), a->size, T_ARRAY, a))) {    if(!(a->type_field & BIT_UNFINISHED) || a->refs!=1)    a->type_field = t;    else
2183:    gc_mark_array_pos = a->next;    gc_mark_array_as_referenced(a);    } -  discard_queue(&gc_mark_queue); +  gc_mark_discard_queue();   }      void gc_free_all_unreferenced_arrays(void)