pike.git / src / mapping.c

version» Context lines:

pike.git/src/mapping.c:1:   /*   || 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.160 2003/01/11 00:01:20 mast Exp $ + || $Id: mapping.c,v 1.161 2003/01/11 03:06:54 mast Exp $   */      #include "global.h" - RCSID("$Id: mapping.c,v 1.160 2003/01/11 00:01:20 mast Exp $"); + RCSID("$Id: mapping.c,v 1.161 2003/01/11 03:06:54 mast Exp $");   #include "main.h"   #include "object.h"   #include "mapping.h"   #include "svalue.h"   #include "array.h"   #include "pike_macros.h"   #include "pike_error.h"   #include "pike_memory.h"   #include "dynamic_buffer.h"   #include "interpret.h"
pike.git/src/mapping.c:2389:    gc_mark_mapping_pos = m->next;    gc_mark_mapping_as_referenced(m);    }    discard_queue(&gc_mark_queue);   }      size_t gc_free_all_unreferenced_mappings(void)   {    struct mapping *m,*next;    struct mapping_data *md; -  size_t freed = 0; +  size_t unreferenced = 0;       for(m=gc_internal_mapping;m;m=next)    {    debug_malloc_touch(m);    debug_malloc_touch(m->data);       if(gc_do_free(m))    {    /* Got an extra ref from gc_cycle_pop(). */    md = m->data;
pike.git/src/mapping.c:2414:    /* Protect against unlink_mapping_data() recursing too far. */    m->data=&empty_data;    add_ref(m->data);       unlink_mapping_data(md);   #ifdef MAPPING_SIZE_DEBUG    m->debug_size=0;   #endif    gc_free_extra_ref(m);    SET_NEXT_AND_FREE(m, free_mapping); -  freed++; +     }    else    {    next=m->next;    } -  +  unreferenced++;    }    -  return freed; +  return unreferenced;   }      #ifdef PIKE_DEBUG      void simple_describe_mapping(struct mapping *m)   {    char *s;    init_buf();    describe_mapping(m,0,2);    s=simple_free_buf();