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: mapping.c,v 1.159 2003/01/10 12:49:03 grubba Exp $ + || $Id: mapping.c,v 1.160 2003/01/11 00:01:20 mast Exp $   */      #include "global.h" - RCSID("$Id: mapping.c,v 1.159 2003/01/10 12:49:03 grubba Exp $"); + RCSID("$Id: mapping.c,v 1.160 2003/01/11 00:01:20 mast Exp $");   #include "main.h"   #include "object.h"   #include "mapping.h"
2392:    discard_queue(&gc_mark_queue);   }    - void gc_free_all_unreferenced_mappings(void) + size_t gc_free_all_unreferenced_mappings(void)   {    struct mapping *m,*next;    struct mapping_data *md; -  +  size_t freed = 0;       for(m=gc_internal_mapping;m;m=next)    {
2420:   #endif    gc_free_extra_ref(m);    SET_NEXT_AND_FREE(m, free_mapping); +  freed++;    }    else    {    next=m->next;    }    } -  +  +  return freed;   }      #ifdef PIKE_DEBUG