pike.git / src / array.c

version» Context lines:

pike.git/src/array.c:18:   #include "cyclic.h"   #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"    - RCSID("$Id: array.c,v 1.108 2003/01/29 15:55:24 mast Exp $"); + RCSID("$Id: array.c,v 1.109 2003/09/08 15:27:57 mast Exp $");      PMOD_EXPORT struct array empty_array=   {    1, /* Never free */   #ifdef PIKE_SECURITY    0,   #endif    &weak_empty_array, /* Next */    &weak_shrink_empty_array, /* previous (circular) */    0, /* Size = 0 */
pike.git/src/array.c:2046:       if(a->flags & ARRAY_WEAK_SHRINK) {    int d=0;   #ifdef PIKE_DEBUG    if (a->refs != 1)    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:2176:   }      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)