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.137 2003/02/01 15:43:50 mast Exp $ + || $Id: array.c,v 1.138 2003/03/14 15:50:43 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:18:   #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"   #include "cyclic.h"    - RCSID("$Id: array.c,v 1.137 2003/02/01 15:43:50 mast Exp $"); + RCSID("$Id: array.c,v 1.138 2003/03/14 15:50:43 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:136:    }   #endif      #ifdef PIKE_DEBUG    if(d_flag > 1) array_check_type_field(v);   #endif       add_ref(v);    EXIT_PIKE_MEMOBJ(v);    free_svalues(ITEM(v), v->size, v->type_field); -  v->refs--; +  sub_ref(v);    array_free_no_free(v);   }      PMOD_EXPORT void do_free_array(struct array *a)   {    if (a)    free_array(a);   }      PMOD_EXPORT struct array *array_set_flags(struct array *a, int flags)
pike.git/src/array.c:210:    }    array_index_no_free(s,a,i);    break;       case T_STRING:    {    check_stack(4);    ref_push_array(a);    assign_svalue_no_free(Pike_sp++,ind);    f_column(2); -  s[0]=Pike_sp[-1]; +     Pike_sp--; -  +  *s = *Pike_sp;    dmalloc_touch_svalue(Pike_sp);    break;    }       default:    {    struct svalue tmp;    tmp.type=T_ARRAY;    tmp.u.array=a;    index_error(0,0,0,&tmp,ind,"Array index is neither int nor string.\n");
pike.git/src/array.c:2383:    }else{    check_stack(120);    BEGIN_AGGREGATE_ARRAY(a->size) {    for(e=0;e<a->size;e++) {    push_array(friendly_slice_array(a, e, e+1));    DO_AGGREGATE_ARRAY(120);    }    } END_AGGREGATE_ARRAY;    }    tmp=(--Pike_sp)->u.array; +  debug_malloc_touch(tmp);    if(tmp->size) tmp->type_field=BIT_ARRAY;    return tmp;   }      PMOD_EXPORT struct array *implode_array(struct array *a, struct array *b)   {    INT32 e, size;    struct array *ret;       if (!a->size) {