Branch: Tag:

2004-09-16

2004-09-16 15:25:34 by Henrik Grubbström (Grubba) <grubba@grubba.org>

New weak multiset fix.

Rev: src/array.c:1.141
Rev: src/array.h:1.45
Rev: src/gc.c:1.201
Rev: src/multiset.c:1.68
Rev: src/multiset.h:1.30

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: array.c,v 1.140 2004/09/16 14:57:23 grubba Exp $ + || $Id: array.c,v 1.141 2004/09/16 15:25:34 grubba Exp $   */      #include "global.h"
27:   #include "multiset.h"   #include "mapping.h"    - RCSID("$Id: array.c,v 1.140 2004/09/16 14:57:23 grubba Exp $"); + RCSID("$Id: array.c,v 1.141 2004/09/16 15:25:34 grubba Exp $");      PMOD_EXPORT struct array empty_array=   {
163:      PMOD_EXPORT struct array *array_set_flags(struct array *a, int flags)   { +  flags = (flags & ~ARRAY_CONSIDER_REALLOC) | +  (a->flags & ARRAY_CONSIDER_REALLOC); +     if (a->size)    a->flags = flags;    else {
1962:    ret=allocate_array_no_init(a->size,0);    doing.pointer_b=(void *)ret;    -  ret->flags = a->flags & ~ARRAY_LVALUE; +  ret->flags = a->flags & ~(ARRAY_LVALUE|ARRAY_CONSIDER_REALLOC);       copy_svalues_recursively_no_free(ITEM(ret),ITEM(a),a->size,&doing);   
2149:    a->item[d++]=a->item[e];    t |= 1 << a->item[e].type;    } +  if (d != a->size) {    a->size=d; -  +  a->flags |= ARRAY_CONSIDER_REALLOC;    } -  +  }    else    if (!(t = debug_gc_mark_weak_svalues(a->item, a->size, T_ARRAY, a)))    t = a->type_field;