Branch: Tag:

2003-01-11

2003-01-11 00:01:21 by Martin Stjernholm <mast@lysator.liu.se>

Provide data for more accurate calculation of freed things in the gc.

Rev: src/array.c:1.134
Rev: src/array.h:1.45
Rev: src/mapping.c:1.160
Rev: src/mapping.h:1.48
Rev: src/multiset.c:1.66
Rev: src/multiset.h:1.31
Rev: src/object.c:1.216
Rev: src/object.h:1.76
Rev: src/program.c:1.472
Rev: src/program.h:1.172

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.133 2002/12/01 00:16:54 mast Exp $ + || $Id: array.c,v 1.134 2003/01/11 00:01:20 mast Exp $   */      #include "global.h"
25:   #include "bignum.h"   #include "cyclic.h"    - RCSID("$Id: array.c,v 1.133 2002/12/01 00:16:54 mast Exp $"); + RCSID("$Id: array.c,v 1.134 2003/01/11 00:01:20 mast Exp $");      PMOD_EXPORT struct array empty_array=   {
2244:    discard_queue(&gc_mark_queue);   }    - void gc_free_all_unreferenced_arrays(void) + size_t gc_free_all_unreferenced_arrays(void)   {    struct array *a,*next; -  +  size_t freed = 0;       for (a = gc_internal_array; a != &weak_empty_array; a = next)    {
2262:       gc_free_extra_ref(a);    SET_NEXT_AND_FREE(a, free_array); +  freed++;    }    else    {    next=a->next;    }    } -  +  +  return freed;   }