pike.git / src / array.c

version» Context lines:

pike.git/src/array.c:16:   #include "pike_types.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.63 2000/03/26 01:53:58 mast Exp $"); + RCSID("$Id: array.c,v 1.64 2000/04/12 18:40:12 hubbe Exp $");      struct array empty_array=   {    1, /* Never free */   #ifdef PIKE_SECURITY    0,   #endif    &empty_array, /* Next */    &empty_array, /* previous (circular) */    0, /* Size = 0 */
pike.git/src/array.c:1792:    {    if (a->item[e].type == T_OBJECT && a->item[e].u.object->prog &&    a->item[e].u.object->prog->flags & PROGRAM_NO_WEAK_FREE)    gc_mark_svalues(a->item + e, 1);    }    else    gc_mark_svalues(ITEM(a), a->size);    }   }    - void gc_check_all_arrays(void) + static void gc_check_array(struct array *a)   { -  struct array *a; -  a=&empty_array; -  do -  { - #ifdef PIKE_DEBUG -  if(d_flag > 1) array_check_type_field(a); - #endif +     if(a->type_field & BIT_COMPLEX)    {    TYPE_FIELD t;    t=debug_gc_check_svalues(ITEM(a), a->size, T_ARRAY, a);       /* 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;    } -  + }    -  + void gc_check_all_arrays(void) + { +  struct array *a; +  a=&empty_array; +  do +  { + #ifdef PIKE_DEBUG +  if(d_flag > 1) array_check_type_field(a); + #endif +  gc_check_array(a);    a=a->next;    } while (a != & empty_array);   }         void gc_mark_all_arrays(void)   {    struct array *a;       a=&empty_array;
pike.git/src/array.c:1898:    }       if(!(next=a->next))    fatal("Null pointer in array list.\n");       free_array(a);    a=next;    }    else    { + #ifdef PIKE_DEBUG +  if(d_flag) gc_check_array(a); + #endif    a=a->next;    }    } while (a != & empty_array);   }         #ifdef PIKE_DEBUG      void debug_dump_type_field(TYPE_FIELD t)   {