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.138 2003/03/14 15:50:43 grubba Exp $ + || $Id: array.c,v 1.139 2003/03/30 16:15:09 mast 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:18:   #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"   #include "cyclic.h"    - RCSID("$Id: array.c,v 1.138 2003/03/14 15:50:43 grubba Exp $"); + RCSID("$Id: array.c,v 1.139 2003/03/30 16:15:09 mast Exp $");      PMOD_EXPORT struct array empty_array=   {    PIKE_CONSTANT_MEMOBJ_INIT(1), /* Never free */    &weak_empty_array, /* Next */    &weak_shrink_empty_array, /* previous (circular) */    0, /* Size = 0 */    0, /* malloced Size = 0 */    0, /* no types */    0, /* no flags */
pike.git/src/array.c:2303: Inside #if defined(PIKE_DEBUG)
   a == &weak_shrink_empty_array ? " (the weak_shrink_empty_array)" :    "");    fprintf(stderr,"Type field = ");    debug_dump_type_field(a->type_field);    fprintf(stderr,"\n");    simple_describe_array(a);   }   #endif       - void zap_all_arrays(void) - { -  struct array *a,*next; -  -  for(a=empty_array.next;a!=&empty_array;a=next) -  { -  - #if defined(PIKE_DEBUG) && defined(DEBUG_MALLOC) -  if(verbose_debug_exit && a!=&empty_array && -  a!=&weak_empty_array && a!=&weak_shrink_empty_array) -  describe(a); - #endif -  -  add_ref(a); -  free_svalues(ITEM(a), a->size, a->type_field); -  a->size=0; -  -  SET_NEXT_AND_FREE(a,free_array); -  } - } -  -  +    void count_memory_in_arrays(INT32 *num_, INT32 *size_)   {    INT32 num=0, size=0;    struct array *m;    for(m=empty_array.next;m!=&weak_empty_array;m=m->next)    {    num++;    size+=sizeof(struct array)+    sizeof(struct svalue) * (m->malloced_size - 1);    }