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.197 2007/12/24 15:33:43 grubba Exp $ + || $Id: array.c,v 1.198 2008/01/26 22:34:17 mast 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:401:    ((v->item + v->size) == (v->real_item + v->malloced_size)))) {    MEMMOVE((char *)(ITEM(v)-1),    (char *)(ITEM(v)),    index * sizeof(struct svalue));    v->item--;    } else {    MEMMOVE((char *)(ITEM(v)+index+1),    (char *)(ITEM(v)+index),    (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 +  assert_free_svalue (ITEM(v) + index);    v->size++;    }else{    struct array *ret;       ret = array_set_flags(allocate_array_no_init(v->size+1, v->size + 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 +  assert_free_svalue (ITEM(ret) + index);    v->size=0;    free_array(v);    v=ret;    }    -  array_set_index(v,index,s); +  array_set_index_no_free (v,index,s);       return v;   }      /*    * lval += ({ @args });    *    * Stack is lvalue followed by arguments.    */   void o_append_array(INT32 args)
pike.git/src/array.c:1598: Inside #if 1
      for(e=0;e<args;e++)    {    v=argp[e].u.array;    if(v->refs == 1 &&    v->malloced_size >= size)    {    if ((v->item - v->real_item) >= tmp) {    debug_malloc_touch(v);    argp[e].type=T_INT; +  argp[e].subtype = NUMBER_NUMBER;    for(tmp=e-1;tmp>=0;tmp--)    {    debug_malloc_touch(argp[tmp].u.array);    v->type_field|=argp[tmp].u.array->type_field;    assign_svalues_no_free(ITEM(v) - argp[tmp].u.array->size,    ITEM(argp[tmp].u.array),    argp[tmp].u.array->size,    argp[tmp].u.array->type_field);    v->item-=argp[tmp].u.array->size;    v->size+=argp[tmp].u.array->size;
pike.git/src/array.c:1638: Inside #if 1
   tmp2 = tmp - (v->item - v->real_item);    v2 = v;    e2 = e;    }    }    tmp+=v->size;    }    if (v2) {    debug_malloc_touch(v2);    argp[e2].type=T_INT; +  argp[e2].subtype = NUMBER_NUMBER;    MEMMOVE((char *)(ITEM(v2)+tmp2), (char *)ITEM(v2),    v2->size * sizeof(struct svalue));    v2->item += tmp2;    for(tmp=e2-1;tmp>=0;tmp--)    {    debug_malloc_touch(argp[tmp].u.array);    v2->type_field|=argp[tmp].u.array->type_field;    assign_svalues_no_free(ITEM(v2) - argp[tmp].u.array->size,    ITEM(argp[tmp].u.array),    argp[tmp].u.array->size,
pike.git/src/array.c:1676: Inside #if 1
   return v2;    }    }   #endif       if(args && argp[0].u.array->refs==1)    {    e=argp[0].u.array->size;    v=resize_array(argp[0].u.array, size);    argp[0].type=T_INT; +  argp[0].subtype = NUMBER_NUMBER;    size=e;    e=1;    }else{    v=allocate_array_no_init(size, 0);    v->type_field=0;    e=size=0;    }       for(; e<args; e++)    {