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.217 2008/07/18 09:37:09 grubba Exp $ + || $Id: array.c,v 1.218 2008/07/18 10:46:30 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:719: Inside #if defined(PIKE_DEBUG)
     #ifdef PIKE_DEBUG    if(start > end || end>v->size || start<0)    Pike_fatal("Illegal arguments to slice_array()\n");       if(d_flag > 1) array_check_type_field(v);   #endif       if(v->refs==1) /* Can we use the same array? */    { -  if((end-start)*2 > v->malloced_size) /* don't waste too much memory */ +  if((end-start)*4 > v->malloced_size) /* 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->size=end-start;   #ifdef PIKE_DEBUG    if(d_flag>1)    check_array(v);   #endif