pike.git / src / array.c

version» Context lines:

pike.git/src/array.c:11:   #include "stralloc.h"   #include "interpret.h"   #include "language.h"   #include "error.h"   #include "pike_types.h"   #include "fsort.h"   #include "builtin_functions.h"   #include "pike_memory.h"   #include "gc.h"   #include "main.h" + #include "security.h"    - RCSID("$Id: array.c,v 1.42 1998/11/22 11:02:31 hubbe Exp $"); + RCSID("$Id: array.c,v 1.43 1999/01/21 09:14:56 hubbe Exp $");      struct array empty_array=   {    1, /* Never free */ -  + #ifdef PIKE_SECURITY +  0, + #endif    &empty_array, /* Next */    &empty_array, /* previous (circular) */    0, /* Size = 0 */    0, /* malloced Size = 0 */    0, /* no types */    0, /* no flags */   };         
pike.git/src/array.c:63:    v->flags=0;       v->malloced_size=size+extra_space;    v->size=size;    v->refs=1;    v->prev=&empty_array;    v->next=empty_array.next;    empty_array.next=v;    v->next->prev=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:96:    free((char *)v);       GC_FREE();   }      /*    * Free an array, call this when the array has zero references    */   void really_free_array(struct array *v)   { -  +    #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);    free_svalues(ITEM(v), v->size, v->type_field);    v->refs--;    array_free_no_free(v);   }      void do_free_array(struct array *a)   {    free_array(a);   }