pike.git / src / array.c

version» Context lines:

pike.git/src/array.c:14:   #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"   #include "stuff.h" + #include "bignum.h"    - RCSID("$Id: array.c,v 1.56 1999/10/03 21:44:17 hubbe Exp $"); + RCSID("$Id: array.c,v 1.57 1999/10/29 03:34:34 mast 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:1766: 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) && !(a->flags & ARRAY_WEAK_FLAG)) -  if(a->type_field & BIT_COMPLEX) +  int e; +  if(gc_mark(a) && a->type_field & BIT_COMPLEX) +  { +  if (a->flags & ARRAY_WEAK_FLAG) +  for (e=0; e<a->size; e++) +  { +  if (a->item[e].type == T_OBJECT && a->item[e].u.object->prog && +  a->item[e].u.object->prog->flags & PROGRAM_NO_WEAK_DESTRUCT) +  gc_mark_svalues(a->item + e, 1); +  } +  else    gc_mark_svalues(ITEM(a), a->size);    } -  + }      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
pike.git/src/array.c:1843:    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)) +  if(a->item[e].type <= MAX_COMPLEX && +  !(a->item[e].type == T_OBJECT && a->item[e].u.object->prog && +  a->item[e].u.object->prog->flags & PROGRAM_NO_WEAK_DESTRUCT) && +  gc_do_free(a->item[e].u.refs))    free_svalue(a->item+e);    else    a->item[d++]=a->item[e];    }    a->size=d;    }else{    for(e=0;e<a->size;e++)    { -  if(a->item[e].type <= MAX_COMPLEX && gc_do_free(a->item[e].u.refs)) +  if(a->item[e].type <= MAX_COMPLEX && +  !(a->item[e].type == T_OBJECT && a->item[e].u.object->prog && +  a->item[e].u.object->prog->flags & PROGRAM_NO_WEAK_DESTRUCT) && +  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;    }    }    }