Branch: Tag:

2001-09-11

2001-09-11 05:37:26 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

some bugfixes in zap_all_arrays()

Rev: src/array.c:1.117

23:   #include "stuff.h"   #include "bignum.h"    - RCSID("$Id: array.c,v 1.116 2001/08/31 06:53:36 hubbe Exp $"); + RCSID("$Id: array.c,v 1.117 2001/09/11 05:37:26 hubbe Exp $");      PMOD_EXPORT struct array empty_array=   {
1620:       if(a->type_field == BIT_INT)    { +  debug_malloc_touch(a);    for(e=0; e<a->size; e++)    if(ITEM(a)[e].u.integer != 0)    break;
1628:    return mkefuncallnode("allocate",mkintnode(a->size));    }    } +  debug_malloc_touch(a);    if(!is_more_than_one_bit(a->type_field))    {    e=0; -  +  debug_malloc_touch(a);    switch(a->type_field)    {    case BIT_INT:
1656:    break;    break;    } +  debug_malloc_touch(a);    if(e == a->size)    return mkefuncallnode("allocate",mknode(F_ARG_LIST,    mkintnode(a->size),
1664:       if(check_that_array_is_constant(a))    { +  debug_malloc_touch(a);    s.type=T_ARRAY;    s.subtype=0;    s.u.array=a;    return mkconstantsvaluenode(&s);    }else{    node *ret=0; -  +  debug_malloc_touch(a);    for(e=0; e<a->size; e++)    ret=mknode(F_ARG_LIST,ret,mksvaluenode(ITEM(a)+e));    return mkefuncallnode("aggregate",ret);
2308:   {    struct array *a,*next;    -  a=&empty_array; -  do +  for(a=empty_array.next;a!=&empty_array;a=next)    {      #if defined(PIKE_DEBUG) && defined(DEBUG_MALLOC)
2322:    free_svalues(ITEM(a), a->size, a->type_field);    a->size=0;    -  if(!(next=a->next)) -  fatal("Null pointer in array list.\n"); -  +     SET_NEXT_AND_FREE(a,free_array); -  } while (a != & empty_array); +     } -  + }         void count_memory_in_arrays(INT32 *num_, INT32 *size_)