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.64 2000/04/22 13:20:39 mast Exp $"); + RCSID("$Id: array.c,v 1.65 2000/04/22 18:48:57 mast Exp $");      struct array empty_array=   {    1, /* Never free */   #ifdef PIKE_SECURITY    0,   #endif    &empty_array, /* Next */    &empty_array, /* previous (circular) */    0, /* Size = 0 */
pike.git/src/array.c:50:   {    struct array *v;    INT32 e;       if(size == 0)    {    add_ref(&empty_array);    return &empty_array;    }    -  GC_ALLOC(); -  +     v=(struct array *)malloc(sizeof(struct array)+    (size+extra_space-1)*sizeof(struct svalue));    if(!v)    error("Couldn't allocate array, out of memory.\n");    -  +  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=size+extra_space;    v->size=size;    v->refs=1;    v->prev=&empty_array;    v->next=empty_array.next;    empty_array.next=v;
pike.git/src/array.c:97:    struct array *next,*prev;       next = v->next;    prev = v->prev;       v->prev->next=next;    v->next->prev=prev;       free((char *)v);    -  GC_FREE(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");