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.57 1999/10/29 03:34:34 mast Exp $"); + RCSID("$Id: array.c,v 1.58 1999/11/23 10:38:15 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:1774:      void gc_mark_array_as_referenced(struct array *a)   {    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) +  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)   {    struct array *a;
pike.git/src/array.c:1856:    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 &&    !(a->item[e].type == T_OBJECT && a->item[e].u.object->prog && -  a->item[e].u.object->prog->flags & PROGRAM_NO_WEAK_DESTRUCT) && +  a->item[e].u.object->prog->flags & PROGRAM_NO_WEAK_FREE) &&    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 &&    !(a->item[e].type == T_OBJECT && a->item[e].u.object->prog && -  a->item[e].u.object->prog->flags & PROGRAM_NO_WEAK_DESTRUCT) && +  a->item[e].u.object->prog->flags & PROGRAM_NO_WEAK_FREE) &&    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;    }    }    }