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/02/01 15:37:22 mast Exp $ + || $Id: array.c,v 1.135 2003/09/08 15:28:14 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/02/01 15:37:22 mast Exp $"); + RCSID("$Id: array.c,v 1.135 2003/09/08 15:28:14 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:2103:       if(a->flags & ARRAY_WEAK_SHRINK) {    int d=0;   #ifdef PIKE_DEBUG    if (a->refs != 1)    Pike_fatal("Got %d refs to weak shrink array "    "which we'd like to change the size on.\n", a->refs);   #endif    t = 0;    for(e=0;e<a->size;e++) -  if (!gc_mark_weak_svalues(a->item+e, 1)) { +  if (!debug_gc_mark_weak_svalues(a->item+e, 1, T_ARRAY, a)) {    a->item[d++]=a->item[e];    t |= 1 << a->item[e].type;    }    a->size=d;    }    else -  if (!(t = gc_mark_weak_svalues(a->item, a->size))) +  if (!(t = debug_gc_mark_weak_svalues(a->item, a->size, T_ARRAY, a)))    t = a->type_field;       /* 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;       gc_assert_checked_as_weak(a);    }    else {    TYPE_FIELD t; -  if ((t = gc_mark_svalues(ITEM(a), a->size))) { +  if ((t = debug_gc_mark_svalues(ITEM(a), a->size, T_ARRAY, a))) {    if(!(a->type_field & BIT_UNFINISHED) || a->refs!=1)    a->type_field = t;    else    a->type_field |= t;    }    gc_assert_checked_as_nonweak(a);    }    }    }   }
pike.git/src/array.c:2232:   }      void gc_zap_ext_weak_refs_in_arrays(void)   {    gc_mark_array_pos = empty_array.next;    while (gc_mark_array_pos != gc_internal_array && gc_ext_weak_refs) {    struct array *a = gc_mark_array_pos;    gc_mark_array_pos = a->next;    gc_mark_array_as_referenced(a);    } -  discard_queue(&gc_mark_queue); +  gc_mark_discard_queue();   }      void gc_free_all_unreferenced_arrays(void)   {    struct array *a,*next;       for (a = gc_internal_array; a != &weak_empty_array; a = next)    {   #ifdef PIKE_DEBUG    if (!a)