pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.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: builtin_functions.c,v 1.478 2003/03/02 14:28:41 grubba Exp $ + || $Id: builtin_functions.c,v 1.479 2003/03/14 15:50:43 grubba Exp $   */      #include "global.h" - RCSID("$Id: builtin_functions.c,v 1.478 2003/03/02 14:28:41 grubba Exp $"); + RCSID("$Id: builtin_functions.c,v 1.479 2003/03/14 15:50:43 grubba Exp $");   #include "interpret.h"   #include "svalue.h"   #include "pike_macros.h"   #include "object.h"   #include "program.h"   #include "array.h"   #include "pike_error.h"   #include "constants.h"   #include "mapping.h"   #include "stralloc.h"
pike.git/src/builtin_functions.c:5928:    INT32 i;       if(!args)    SIMPLE_TOO_FEW_ARGS_ERROR("_leak", 1);       if(Pike_sp[-args].type > MAX_REF_TYPE)    SIMPLE_BAD_ARG_ERROR("_leak", 1,    "array|mapping|multiset|object|"    "function|program|string");    -  add_ref(Pike_sp[-args].u.array); +  add_ref(Pike_sp[-args].u.dummy);    i=Pike_sp[-args].u.refs[0];    pop_n_elems(args);    push_int(i);   }      /*! @decl type _typeof(mixed x)    *!    *! Return the runtime type of @[x].    *!    *! @seealso
pike.git/src/builtin_functions.c:6258:    one.u.integer = 1;    for(i =0; i< a->size; i++)    {    mapping_insert(m, ITEM(a)+i, &one);    if(m_sizeof(m) != size)    {    size=m_sizeof(m);    assign_svalue_no_free(ITEM(b)+ j++, ITEM(a)+i);    }    } +  dmalloc_touch_svalue(Pike_sp-1);    Pike_sp--; /* keep the ref to 'b' */    b=resize_array(b, j);    pop_n_elems(args-1); /* pop args and the mapping */    push_array(b);   }      /*! @decl array(mixed) splice(array(mixed) arr1, array(mixed) arr2, @    *! array(mixed) ... more_arrays)    *!    *! Splice two or more arrays.
pike.git/src/builtin_functions.c:6723:    map(values(arr),fun,@extra)); */    f_aggregate(args-2);    mysp=Pike_sp;    splice=mysp[-1].u.array->size;       push_svalue(mysp-3); /* arr */    f_values(1);    push_svalue(mysp-2); /* fun */    *Pike_sp=mysp[-1]; /* extra */    mysp[-1].type=T_INT; +  dmalloc_touch_svalue(Pike_sp);    push_array_items(Pike_sp->u.array);    f_map(splice+2); /* ... arr fun extra -> ... retval */    stack_pop_n_elems_keep_top(2); /* arr fun extra ret -> arr retval */    stack_swap(); /* retval arr */    f_indices(1); /* retval retind */    stack_swap(); /* retind retval */    f_mkmapping(2); /* ret :-) */    return;       case T_MULTISET:
pike.git/src/builtin_functions.c:6747:    Pike_sp[-args-1].type=T_INT;    f_indices(1); /* call f_indices */    Pike_sp--;    dmalloc_touch_svalue(Pike_sp);    Pike_sp[-args]=Pike_sp[0]; /* move it back */    f_map(args);   #ifdef PIKE_NEW_MULTISETS    /* FIXME: Handle multisets with values like mappings. */    push_multiset (mkmultiset_2 (Pike_sp[-1].u.array, NULL, NULL));    free_array (Pike_sp[-2].u.array); +  dmalloc_touch_svalue(Pike_sp-1);    Pike_sp[-2] = Pike_sp[-1];    Pike_sp--;   #else    Pike_sp--; /* allocate_multiset is destructive */    dmalloc_touch_svalue(Pike_sp);    push_multiset(allocate_multiset(Pike_sp->u.array));    order_multiset(Pike_sp[-1].u.multiset);   #endif    return;   
pike.git/src/builtin_functions.c:7139:    /* mapping ret =    mkmapping(indices(arr),    map(values(arr),fun,@extra)); */    MEMMOVE(Pike_sp-args+2,Pike_sp-args,args*sizeof(*Pike_sp));    Pike_sp+=2;    Pike_sp[-args-2].type=T_INT;    Pike_sp[-args-1].type=T_INT;       push_svalue(Pike_sp-args);    f_indices(1); +  dmalloc_touch_svalue(Pike_sp-1);    Pike_sp--;    Pike_sp[-args-2]=*Pike_sp;    dmalloc_touch_svalue(Pike_sp);    push_svalue(Pike_sp-args);    f_values(1);    Pike_sp--;    Pike_sp[-args-1]=*Pike_sp;    dmalloc_touch_svalue(Pike_sp);       assign_svalue(Pike_sp-args,Pike_sp-args-1); /* loop values only */
pike.git/src/builtin_functions.c:7182:    f_indices(1); /* call f_indices */    Pike_sp--;    dmalloc_touch_svalue(Pike_sp);    Pike_sp[-args]=Pike_sp[0]; /* move it back */    f_filter(args);   #ifdef PIKE_NEW_MULTISETS    /* FIXME: Handle multisets with values like mappings. */    push_multiset (mkmultiset_2 (Pike_sp[-1].u.array, NULL, NULL));    free_array (Pike_sp[-2].u.array);    Pike_sp[-2] = Pike_sp[-1]; +  dmalloc_touch_svalue(Pike_sp-1);    Pike_sp--;   #else    Pike_sp--; /* allocate_multiset is destructive */    dmalloc_touch_svalue(Pike_sp);    push_multiset(allocate_multiset(Pike_sp->u.array));    order_multiset(Pike_sp[-1].u.multiset);   #endif    return;       case T_STRING: