pike.git / src / mapping.c

version» Context lines:

pike.git/src/mapping.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   #include "global.h" - RCSID("$Id: mapping.c,v 1.33 1998/05/14 21:45:21 hubbe Exp $"); + RCSID("$Id: mapping.c,v 1.34 1998/05/16 08:21:47 hubbe Exp $");   #include "main.h"   #include "object.h"   #include "mapping.h"   #include "svalue.h"   #include "array.h"   #include "pike_macros.h"   #include "language.h"   #include "error.h"   #include "pike_memory.h"   #include "dynamic_buffer.h"
pike.git/src/mapping.c:929:    to->type=T_INT;    to->subtype=NUMBER_UNDEFINED;    to->u.integer=0;   }         #ifdef DEBUG      void check_mapping(struct mapping *m)   { +  int e,num; +  struct keypair *k; +     if(m->refs <=0)    fatal("Mapping has zero refs.\n");       if(m->next && m->next->prev != m)    fatal("Mapping ->next->prev != mapping.\n");       if(m->prev)    {    if(m->prev->next != m)    fatal("Mapping ->prev->next != mapping.\n");
pike.git/src/mapping.c:959: Inside #if defined(DEBUG)
      if(m->size > (m->hashsize + 3) * AVG_LINK_LENGTH)    fatal("Pretty mean hashtable there buster!.\n");       if(m->size > 0 && (!m->ind_types || !m->val_types))    fatal("Mapping type fields are... wrong.\n");       if(!m->hash && m->size)    fatal("Hey! where did my hashtable go??\n");    +  num=0; +  MAPPING_LOOP(m) +  { +  num++; +  +  if(! ( (1 << k->ind.type) & (m->ind_types) )) +  fatal("Mapping indices type field lies.\n"); +  +  if(! ( (1 << k->val.type) & (m->val_types) )) +  fatal("Mapping values type field lies.\n"); +     }    -  +  if(m->size != num) +  fatal("Shields are failing, hull integrity down to 20%%\n"); + } +    void check_all_mappings(void)   {    struct mapping *m;    for(m=first_mapping;m;m=m->next)    check_mapping(m);   }   #endif         void gc_mark_mapping_as_referenced(struct mapping *m)