pike.git / src / array.c

version» Context lines:

pike.git/src/array.c:12:   #include "stralloc.h"   #include "interpret.h"   #include "opcodes.h"   #include "pike_error.h"   #include "pike_types.h"   #include "fsort.h"   #include "builtin_functions.h"   #include "pike_memory.h"   #include "gc.h"   #include "main.h" - #include "pike_security.h" +    #include "stuff.h"   #include "bignum.h"   #include "cyclic.h"   #include "multiset.h"   #include "mapping.h"      /** The empty array. */   PMOD_EXPORT struct array empty_array=   { -  PIKE_CONSTANT_MEMOBJ_INIT(1, PIKE_T_ARRAY), /* Never free */ +  1, /* refs, Never free */ +  0, /* Size = 0 */    &weak_empty_array, /* Next */    0, /* previous */ -  0, /* Size = 0 */ +     0, /* malloced Size = 0 */    0, /* no types */    0, /* no flags */    empty_array.real_item, /* Initialize the item pointer. */    {SVALUE_INIT_FREE},   };      /** The empty weak array. */   PMOD_EXPORT struct array weak_empty_array=   { -  PIKE_CONSTANT_MEMOBJ_INIT(1, PIKE_T_ARRAY), -  0, &empty_array, 0, 0, 0, ARRAY_WEAK_FLAG, +  1, /* refs */ +  0, /* size */ +  0, /* next */ +  &empty_array, /* prev */ +  0, /*malloced */ +  0, /* types */ +  ARRAY_WEAK_FLAG, /* flags */    weak_empty_array.real_item,    {SVALUE_INIT_FREE},   };      struct array *first_array = &empty_array;   struct array *gc_internal_array = 0;   static struct array *gc_mark_array_pos;      #ifdef TRACE_UNFINISHED_TYPE_FIELDS   PMOD_EXPORT int accept_unfinished_type_fields = 0;
pike.git/src/array.c:104:    if (size+extra_space)    /* for now, we don't know what will go in here */    v->type_field = BIT_MIXED | BIT_UNFINISHED;    else    v->type_field = 0;    v->flags=0;       v->malloced_size = DO_NOT_WARN((INT32)(size + extra_space));    v->item=v->real_item;    v->size = DO_NOT_WARN((INT32)size); -  INIT_PIKE_MEMOBJ(v, T_ARRAY); +  v->refs = 1;    DOUBLELINK (first_array, v);       {    struct svalue *item = ITEM(v);    struct svalue *item_end = item + v->size;    while (item < item_end)    *item++ = svalue_int_zero;    }       return v;
pike.git/src/array.c:153: Inside #if defined(PIKE_DEBUG)
  #endif    Pike_fatal("Freeing array with %d refs.\n", v->refs);    }   #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);    sub_ref(v);    array_free_no_free(v);   }      /**    * Decrement the references (and free if unused) an array if it is not null.    */   PMOD_EXPORT void do_free_array(struct array *a)   {