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.76 2000/07/07 01:26:39 hubbe Exp $"); + RCSID("$Id: array.c,v 1.77 2000/07/11 03:45:09 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:1950:    for (a = gc_internal_array; a != &empty_array; a = a->next) {    real_gc_cycle_check_array(a);    run_lifo_queue(&gc_mark_queue);    }   }      void gc_free_all_unreferenced_arrays(void)   {    struct array *a,*next;    +  if (gc_ext_weak_refs) { +  /* Have to go through all marked things if we got external weak +  * references to otherwise unreferenced things, so the mark +  * functions can free those references. */ +  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); +  } +     for (a = gc_internal_array; a != &empty_array; a = next)    {   #ifdef PIKE_DEBUG    if (!a)    fatal("Null pointer in array list.\n");   #endif    if(gc_do_free(a))    {    /* Got an extra ref from gc_cycle_pop(). */    free_svalues(ITEM(a), a->size, a->type_field);