pike.git / src / array.c

version» Context lines:

pike.git/src/array.c:13:   #include "language.h"   #include "error.h"   #include "pike_types.h"   #include "fsort.h"   #include "builtin_functions.h"   #include "pike_memory.h"   #include "gc.h"   #include "main.h"   #include "security.h"    - RCSID("$Id: array.c,v 1.45 1999/03/19 11:40:12 hubbe Exp $"); + RCSID("$Id: array.c,v 1.46 1999/04/12 02:24:10 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:1678: Inside #if defined(PIKE_DEBUG)
   a=a->next;    if(!a)    fatal("Null pointer in array list.\n");    } while (a != & empty_array);   }   #endif /* PIKE_DEBUG */         void gc_mark_array_as_referenced(struct array *a)   { -  if(gc_mark(a)) +  if(gc_mark(a) && !(a->flags & ARRAY_WEAK_FLAG))    if(a->type_field & BIT_COMPLEX)    gc_mark_svalues(ITEM(a), a->size);   }      void gc_check_all_arrays(void)   {    struct array *a;    a=&empty_array;    do    {
pike.git/src/array.c:1744:    {    add_ref(a);    free_svalues(ITEM(a), a->size, a->type_field);    a->size=0;       if(!(next=a->next))    fatal("Null pointer in array list.\n");       free_array(a);    a=next; +  } +  else if(a->flags & ARRAY_WEAK_FLAG) +  { +  int e; +  add_ref(a); +  +  if(a->flags & ARRAY_WEAK_SHRINK) +  { +  int d=0; +  for(e=0;e<a->size;e++) +  { +  if(a->item[e].type <= MAX_COMPLEX && gc_do_free(a->item[e].u.refs)) +  free_svalue(a->item+e); +  else +  a->item[d++]=a->item[e]; +  } +  a->size=e;    }else{ -  +  for(e=0;e<a->size;e++) +  { +  if(a->item[e].type <= MAX_COMPLEX && gc_do_free(a->item[e].u.refs)) +  { +  free_svalue(a->item+e); +  a->item[e].type=T_INT; +  a->item[e].u.integer=0; +  a->item[e].subtype=NUMBER_DESTRUCTED; +  a->type_field |= BIT_INT; +  } +  } +  } +  +  if(!(next=a->next)) +  fatal("Null pointer in array list.\n"); +  +  free_array(a); +  a=next; +  } +  else +  {    a=a->next;    }    } while (a != & empty_array);   }         #ifdef PIKE_DEBUG      void debug_dump_type_field(TYPE_FIELD t)   {