Branch: Tag:

2003-09-08

2003-09-08 15:28:15 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.135
Rev: src/gc.c:1.196
Rev: src/gc.h:1.95
Rev: src/mapping.c:1.160
Rev: src/object.c:1.221
Rev: src/program.c:1.478
Rev: src/svalue.c:1.156

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: array.c,v 1.134 2003/02/01 15:37:22 mast Exp $ + || $Id: array.c,v 1.135 2003/09/08 15:28:14 mast Exp $   */      #include "global.h"
25:   #include "bignum.h"   #include "cyclic.h"    - RCSID("$Id: array.c,v 1.134 2003/02/01 15:37:22 mast Exp $"); + RCSID("$Id: array.c,v 1.135 2003/09/08 15:28:14 mast Exp $");      PMOD_EXPORT struct array empty_array=   {
2110:   #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
2133:    }    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
2239:    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)