Branch: Tag:

2000-02-09

2000-02-09 07:29:38 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

more debug (use with -d2)

Rev: src/mapping.c:1.63
Rev: src/mapping.h:1.21

5:   \*/   /**/   #include "global.h" - RCSID("$Id: mapping.c,v 1.62 2000/02/06 01:49:54 hubbe Exp $"); + RCSID("$Id: mapping.c,v 1.63 2000/02/09 07:29:36 hubbe Exp $");   #include "main.h"   #include "object.h"   #include "mapping.h"
159:    }    add_ref(md);    m->data=md; + #ifdef PIKE_DEBUG +  m->size = md->size; + #endif   }      /* This function allocates an empty mapping with room for 'size' values
319: Inside #if defined(PIKE_DEBUG)
  #ifdef PIKE_DEBUG    if(m->data->size != tmp)    fatal("Rehash failed, size not same any more.\n"); +  +  m->size = m->data->size;   #endif      #ifdef PIKE_DEBUG
384:    if(md->hashsize) \    { \    h=h2 % md->hashsize; \ +  DO_IF_DEBUG( if(d_flag > 1) check_mapping_type_fields(m); ) \    if(md->ind_types & (1 << key->type)) \    { \    for(prev= md->hash + h;(k=*prev);prev=&k->next) \
406:    if(md->hashsize) \    { \    h=h2 % md->hashsize; \ +  DO_IF_DEBUG( if(d_flag > 1) check_mapping_type_fields(m); ) \    if(md->ind_types & (1 << key->type)) \    { \    k2=omd->hash[h2 % md->hashsize]; \
615:    assign_svalue_no_free(& k->val, val);    k->hval = h2;    md->size++; + #ifdef PIKE_DEBUG +  m->size++; + #endif      #ifdef PIKE_DEBUG    if(d_flag>1) check_mapping(m);
722:    md->ind_types |= 1 << key->type;    md->val_types |= BIT_INT;    md->size++; + #ifdef PIKE_DEBUG +  m->size++; + #endif      #ifdef PIKE_DEBUG    if(d_flag > 1) check_mapping_type_fields(m);
794:    k->next=md->free_list;    md->free_list=k;    md->size--; + #ifdef PIKE_DEBUG +  m->size--; + #endif       if(md->size < (md->hashsize + 1) * MIN_LINK_LENGTH)    {
845:    k->next=md->free_list;    md->free_list=k;    md->size--; + #ifdef PIKE_DEBUG +  m->size++; + #endif    }else{    val_types |= 1 << k->val.type;    ind_types |= 1 << k->ind.type;
1554:    }    }    +  if(d_flag > 1) check_mapping_type_fields(m);    if(!((m->data->val_types | m->data->ind_types) & BIT_COMPLEX))    return copy_mapping(m);   
1679: Inside #if defined(PIKE_DEBUG)
   if(m->next && m->next->prev != m)    fatal("Mapping ->next->prev != mapping.\n");    +  if(m->size != md->size) +  fatal("Mapping zapping detected!\n"); +     if(m->prev)    {    if(m->prev->next != m)
1881:    k->next=md->free_list;    md->free_list=k;    md->size--; + #ifdef PIKE_DEBUG +  m->size++; + #endif    }else{    prev=&k->next;    }
1961:    }    }    md->size=0; + #ifdef PIKE_DEBUG +  m->size=0; + #endif       next=m->next;