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.102 2001/02/03 01:04:48 mast Exp $"); + RCSID("$Id: array.c,v 1.103 2001/04/07 07:38:23 hubbe Exp $");      PMOD_EXPORT struct array empty_array=   {    1, /* Never free */   #ifdef PIKE_SECURITY    0,   #endif -  + #ifdef USE_LOCAL_MUTEX +  PTHREAD_MUTEX_INITIALIZER, + #endif    &empty_array, /* Next */    &empty_array, /* previous (circular) */    0, /* Size = 0 */    0, /* malloced Size = 0 */    0, /* no types */    0, /* no flags */   };      struct array *gc_internal_array = &empty_array;   static struct array *gc_mark_array_pos = 0;
pike.git/src/array.c:66:       GC_ALLOC(v);          /* for now, we don't know what will go in here */    v->type_field=BIT_MIXED | BIT_UNFINISHED;    v->flags=0;       v->malloced_size = DO_NOT_WARN((INT32)(size + extra_space));    v->size = DO_NOT_WARN((INT32)size); -  v->refs=1; +  INIT_PIKE_MEMOBJ(v);    LINK_ARRAY(v);    -  INITIALIZE_PROT(v); -  +     for(e=0;e<v->size;e++)    {    ITEM(v)[e].type=T_INT;    ITEM(v)[e].subtype=NUMBER_NUMBER;    ITEM(v)[e].u.integer=0;    }       return v;   }   
pike.git/src/array.c:108: Inside #if defined(PIKE_DEBUG)
  #ifdef PIKE_DEBUG    if(v == & empty_array)    fatal("Tried to free the empty_array.\n");   #endif      #ifdef PIKE_DEBUG    if(d_flag > 1) array_check_type_field(v);   #endif       add_ref(v); -  FREE_PROT(v); +  EXIT_PIKE_MEMOBJ(v);    free_svalues(ITEM(v), v->size, v->type_field);    v->refs--;    array_free_no_free(v);   }      PMOD_EXPORT void do_free_array(struct array *a)   {    if (a)    free_array(a);   }