Branch: Tag:

2004-03-15

2004-03-15 22:23:14 by Martin Stjernholm <mast@lysator.liu.se>

Made the array list acyclic like the rest of the double linked list. Makes
things simpler, and I want in the gc to be able to tell a pointer that have
visited zero arrays from one that have visited all of them, without special
cases.

Rev: src/array.c:1.154
Rev: src/array.h:1.55
Rev: src/gc.c:1.241
Rev: src/main.c:1.191

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: gc.c,v 1.240 2004/03/15 19:03:48 mast Exp $ + || $Id: gc.c,v 1.241 2004/03/15 22:23:14 mast Exp $   */      #include "global.h"
33:      #include "block_alloc.h"    - RCSID("$Id: gc.c,v 1.240 2004/03/15 19:03:48 mast Exp $"); + RCSID("$Id: gc.c,v 1.241 2004/03/15 22:23:14 mast Exp $");      int gc_enabled = 1;   
284:       if (inblock) *inblock = 0;    -  a=&empty_array; -  do -  { +  for (a = first_array; a; a = a->next) {    if(a==(struct array *)something) return T_ARRAY; -  a=a->next; -  }while(a!=&empty_array); +  }       for(o=first_object;o;o=o->next) {    if(o==(struct object *)something)
2196: Inside #if defined(PIKE_DEBUG)
   struct program *p;    struct mapping *m;    struct multiset *l; -  for(a = gc_internal_array; a != &empty_array; a = a->next) +  for(a = gc_internal_array; a; a = a->next)    if(a == (struct array *) x) goto on_gc_internal_lists;    for(o = gc_internal_object; o; o = o->next)    if(o == (struct object *) x) goto on_gc_internal_lists;
2794:    /* Anything after and including gc_internal_* in the linked lists    * are considered to lack external references. The mark pass move    * externally referenced things in front of these pointers. */ -  gc_internal_array = empty_array.next; +  gc_internal_array = first_array;    gc_internal_multiset = first_multiset;    gc_internal_mapping = first_mapping;    gc_internal_program = first_program;
2946:    * added above are removed just before the calls so we'll get the    * correct relative positions in them. */    unreferenced = 0; -  if (gc_internal_array != &weak_empty_array) +  if (gc_internal_array)    unreferenced += gc_free_all_unreferenced_arrays();    if (gc_internal_multiset)    unreferenced += gc_free_all_unreferenced_multisets();