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.73 2000/04/15 05:05:28 hubbe Exp $"); + RCSID("$Id: mapping.c,v 1.74 2000/04/15 09:34:02 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:617:    md->free_list=k->next;    k->next=md->hash[h];    md->hash[h]=k;    md->ind_types |= 1 << key->type;    md->val_types |= 1 << val->type;    assign_svalue_no_free(& k->ind, key);    assign_svalue_no_free(& k->val, val);    k->hval = h2;    md->size++;   #ifdef PIKE_DEBUG +  if(m->data ==md)    m->debug_size++;   #endif      #ifdef PIKE_DEBUG    if(d_flag>1) check_mapping(m);   #endif   }      void mapping_insert(struct mapping *m,    struct svalue *key,
pike.git/src/mapping.c:727:    md->hash[h]=k;    assign_svalue_no_free(& k->ind, key);    k->val.type=T_INT;    k->val.subtype=NUMBER_NUMBER;    k->val.u.integer=0;    k->hval = h2;    md->ind_types |= 1 << key->type;    md->val_types |= BIT_INT;    md->size++;   #ifdef PIKE_DEBUG +  if(m->data ==md)    m->debug_size++;   #endif      #ifdef PIKE_DEBUG    if(d_flag > 1) check_mapping_type_fields(m);   #endif       return & ( k->val.u );   }   
pike.git/src/mapping.c:802:    else    free_svalue(& k->val);       k->ind.type=T_INT;    k->val.type=T_INT;       k->next=md->free_list;    md->free_list=k;    md->size--;   #ifdef PIKE_DEBUG +  if(m->data ==md)    m->debug_size--;   #endif       if(md->size < (md->hashsize + 1) * MIN_LINK_LENGTH)    {    debug_malloc_touch(m);    rehash(m, MAP_SLOTS(m->data->size));    }      #ifdef PIKE_DEBUG
pike.git/src/mapping.c:856:    !k->ind.u.object->prog)    {    PREPARE_FOR_INDEX_CHANGE2();    *prev=k->next;    free_svalue(& k->ind);    free_svalue(& k->val);    k->next=md->free_list;    md->free_list=k;    md->size--;   #ifdef PIKE_DEBUG +  if(m->data ==md)    m->debug_size++;   #endif    }else{    val_types |= 1 << k->val.type;    ind_types |= 1 << k->ind.type;    prev=&k->next;    }    }    }    if(MAP_SLOTS(md->size) < md->hashsize * MIN_LINK_LENGTH)
pike.git/src/mapping.c:1929:    gc_do_free(k->ind.u.refs)))    {    PREPARE_FOR_INDEX_CHANGE();    *prev=k->next;    free_svalue(& k->ind);    free_svalue(& k->val);    k->next=md->free_list;    md->free_list=k;    md->size--;   #ifdef PIKE_DEBUG +  if(m->data ==md)    m->debug_size--;   #endif    }else{    prev=&k->next;    }    }    }    if(MAP_SLOTS(md->size) < md->hashsize * MIN_LINK_LENGTH)    {    debug_malloc_touch(m);
pike.git/src/mapping.c:2016:    {    md->hash[e]=k->next;    k->next=md->free_list;    md->free_list=k;    free_svalue(&k->ind);    free_svalue(&k->val);    }    }    md->size=0;   #ifdef PIKE_DEBUG +  if(m->data ==md)    m->debug_size=0;   #endif       next=m->next;       /* free_mapping(m); */    }   }