Branch: Tag:

2000-07-04

2000-07-04 00:43:58 by Martin Stjernholm <mast@lysator.liu.se>

Expelled even the innocent zeroing of destructed object references from
the gc check pass. It's upsetting the debug checks, and it's cleaner to
do all zapping of refs in the mark/cycle check pass anyway.

Rev: src/array.c:1.74
Rev: src/gc.c:1.101
Rev: src/gc.h:1.53
Rev: src/mapping.c:1.90
Rev: src/object.c:1.131
Rev: src/svalue.c:1.81
Rev: src/svalue.h:1.60

23:   #include "stuff.h"   #include "bignum.h"    - RCSID("$Id: array.c,v 1.73 2000/06/09 22:43:04 mast Exp $"); + RCSID("$Id: array.c,v 1.74 2000/07/04 00:43:56 mast Exp $");      struct array empty_array=   {
1784:   {    if(a->type_field & BIT_COMPLEX)    { -  TYPE_FIELD t; +     if (a->flags & ARRAY_WEAK_FLAG) -  t=debug_gc_check_weak_svalues(ITEM(a), a->size, T_ARRAY, a); +  debug_gc_check_weak_svalues(ITEM(a), a->size, T_ARRAY, a);    else -  t=debug_gc_check_svalues(ITEM(a), a->size, T_ARRAY, a); -  -  /* Ugly, but we are not allowed to change type_field -  * at the same time as the array is being built... -  * Actually we just need better primitives for building arrays. -  */ -  if(!(a->type_field & BIT_UNFINISHED) || a->refs!=1) -  a->type_field = t; -  else -  a->type_field |= t; +  debug_gc_check_svalues(ITEM(a), a->size, T_ARRAY, a);    }   }      static void gc_recurse_weak_array(struct array *a, -  TYPE_FIELD (*recurse_fn)(struct svalue *, int)) +  TYPE_FIELD (*recurse_fn)(struct svalue *, size_t))   {    int e;    TYPE_FIELD t;
1857:    {    if (a->flags & ARRAY_WEAK_FLAG)    gc_recurse_weak_array(a, gc_mark_weak_svalues); +  else { +  TYPE_FIELD t; +  if ((t = gc_mark_svalues(ITEM(a), a->size))) { +  if(!(a->type_field & BIT_UNFINISHED) || a->refs!=1) +  a->type_field = t;    else -  gc_mark_svalues(ITEM(a), a->size); +  a->type_field |= t;    }    }    } -  +  } + }      static void low_gc_cycle_check_array(struct array *a)   {
1874:    {    if (a->flags & ARRAY_WEAK_FLAG)    gc_recurse_weak_array(a, gc_cycle_check_weak_svalues); +  else { +  TYPE_FIELD t; +  if ((t = gc_cycle_check_svalues(ITEM(a), a->size))) { +  if(!(a->type_field & BIT_UNFINISHED) || a->refs!=1) +  a->type_field = t;    else -  gc_cycle_check_svalues(ITEM(a), a->size); +  a->type_field |= t;    }    } -  +  } + }      void real_gc_cycle_check_array(struct array *a)   {