pike.git / src / array.c

version» Context lines:

pike.git/src/array.c:1:   /*   || 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.141 2004/09/16 15:25:34 grubba Exp $ + || $Id: array.c,v 1.142 2004/09/16 17:41:03 grubba Exp $   */      #include "global.h"   #include "svalue.h"   #include "array.h"   #include "object.h"   #include "las.h"   #include "stralloc.h"   #include "interpret.h"   #include "opcodes.h"
pike.git/src/array.c:20:   #include "pike_memory.h"   #include "gc.h"   #include "main.h"   #include "security.h"   #include "stuff.h"   #include "bignum.h"   #include "cyclic.h"   #include "multiset.h"   #include "mapping.h"    - RCSID("$Id: array.c,v 1.141 2004/09/16 15:25:34 grubba Exp $"); + RCSID("$Id: array.c,v 1.142 2004/09/16 17:41:03 grubba Exp $");      PMOD_EXPORT struct array empty_array=   {    PIKE_CONSTANT_MEMOBJ_INIT(1), /* Never free */    &weak_empty_array, /* Next */    &weak_shrink_empty_array, /* previous (circular) */    0, /* Size = 0 */    0, /* malloced Size = 0 */    0, /* no types */    0, /* no flags */
pike.git/src/array.c:323:    (v->size-index) * sizeof(struct svalue));    ITEM(v)[index].type=T_INT;   #ifdef __CHECKER__    ITEM(v)[index].subtype=0;    ITEM(v)[index].u.refs=0;   #endif    v->size++;    }else{    struct array *ret;    -  ret=allocate_array_no_init(v->size+1, (v->size >> 3) + 1); +  ret = array_set_flags(allocate_array_no_init(v->size+1, (v->size >> 3) + 1), +  v->flags);    ret->type_field = v->type_field;       MEMCPY(ITEM(ret), ITEM(v), sizeof(struct svalue) * index);    MEMCPY(ITEM(ret)+index+1, ITEM(v)+index, sizeof(struct svalue) * (v->size-index));    ITEM(ret)[index].type=T_INT;   #ifdef __CHECKER__    ITEM(ret)[index].subtype=0;    ITEM(ret)[index].u.refs=0;   #endif    v->size=0;
pike.git/src/array.c:1943:      PMOD_EXPORT struct array *copy_array_recursively(struct array *a,struct processing *p)   {    struct processing doing;    struct array *ret;      #ifdef PIKE_DEBUG    if(d_flag > 1) array_check_type_field(a);   #endif    +  if (!a->size) { +  add_ref(&empty_array); +  return array_set_flags(&empty_array, +  a->flags & ~(ARRAY_LVALUE|ARRAY_CONSIDER_REALLOC)); +  } +     doing.next=p;    doing.pointer_a=(void *)a;    for(;p;p=p->next)    {    if(p->pointer_a == (void *)a)    {    ret=(struct array *)p->pointer_b;    add_ref(ret);    return ret;    }