pike.git / src / array.c

version» Context lines:

pike.git/src/array.c:16:   #include "pike_types.h"   #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"    - RCSID("$Id: array.c,v 1.107 2001/06/07 08:26:46 hubbe Exp $"); + RCSID("$Id: array.c,v 1.108 2001/06/07 21:45:26 hubbe 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:513: Inside #if defined(PIKE_DEBUG)
   if(start > end || end>v->size || start<0)    fatal("Illegal arguments to slice_array()\n");       if(d_flag > 1) array_check_type_field(v);   #endif      #if 1    if(v->refs==1) /* Can we use the same array? */    {    if((end-start) && -  (end-start)*2 > v->malloced_size +4 ) /* don't waste too much memory */ +  (end-start)*2 > +  v->malloced_size+4+(v->item-v->real_item) ) /* don't waste too much memory */    {    add_ref(v);    free_svalues(ITEM(v) + end, v->size - end, v->type_field);    free_svalues(ITEM(v), start, v->type_field);    v->item+=start;    v->malloced_size+=start;    v->size=end-start; -  + #ifdef PIKE_DEBUG +  if(d_flag>1) +  check_array(v); + #endif    return v;    }    }   #endif       a=allocate_array_no_init(end-start,0);    a->type_field = v->type_field;       assign_svalues_no_free(ITEM(a), ITEM(v)+start, end-start, v->type_field);