pike.git / src / array.c

version» Context lines:

pike.git/src/array.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: array.c,v 1.134 2003/01/11 00:01:20 mast Exp $ + || $Id: array.c,v 1.135 2003/01/11 03:06:54 mast Exp $   */      #include "global.h"   #include "svalue.h"   #include "array.h"   #include "object.h"   #include "las.h"   #include "stralloc.h"   #include "interpret.h"   #include "opcodes.h"
pike.git/src/array.c:18:   #include "fsort.h"   #include "builtin_functions.h"   #include "pike_memory.h"   #include "gc.h"   #include "main.h"   #include "security.h"   #include "stuff.h"   #include "bignum.h"   #include "cyclic.h"    - RCSID("$Id: array.c,v 1.134 2003/01/11 00:01:20 mast Exp $"); + RCSID("$Id: array.c,v 1.135 2003/01/11 03:06:54 mast Exp $");      PMOD_EXPORT struct array empty_array=   {    PIKE_CONSTANT_MEMOBJ_INIT(1), /* Never free */    &weak_empty_array, /* Next */    &weak_shrink_empty_array, /* previous (circular) */    0, /* Size = 0 */    0, /* malloced Size = 0 */    0, /* no types */    0, /* no flags */
pike.git/src/array.c:2240:    struct array *a = gc_mark_array_pos;    gc_mark_array_pos = a->next;    gc_mark_array_as_referenced(a);    }    discard_queue(&gc_mark_queue);   }      size_t gc_free_all_unreferenced_arrays(void)   {    struct array *a,*next; -  size_t freed = 0; +  size_t unreferenced = 0;       for (a = gc_internal_array; a != &weak_empty_array; a = next)    {   #ifdef PIKE_DEBUG    if (!a)    Pike_fatal("Null pointer in array list.\n");   #endif    if(gc_do_free(a))    {    /* Got an extra ref from gc_cycle_pop(). */    free_svalues(ITEM(a), a->size, a->type_field);    a->size=0;       gc_free_extra_ref(a);    SET_NEXT_AND_FREE(a, free_array); -  freed++; +     }    else    {    next=a->next;    } -  +  unreferenced++;    }    -  return freed; +  return unreferenced;   }         #ifdef PIKE_DEBUG      void debug_dump_type_field(TYPE_FIELD t)   {    int e;    for(e=0;e<=MAX_TYPE;e++)    if(t & (1<<e))