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.64 2000/02/09 18:50:19 hubbe Exp $"); + RCSID("$Id: mapping.c,v 1.65 2000/02/09 23:49:17 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:1191: Inside #if defined(PIKE_DEBUG)
  #ifdef PIKE_DEBUG    if(m->data->refs <=0)    fatal("Zero refs in mapping->data\n");   #endif       n=allocate_mapping(0);    if(!m_sizeof(m)) return n; /* done */    debug_malloc_touch(n->data);    free_mapping_data(n->data);    n->data=m->data; + #ifdef PIKE_DEBUG +  n->debug_size=n->data->size; + #endif    n->data->refs++;    n->data->valrefs++;    n->data->hardlinks++;    debug_malloc_touch(n->data);    return n;   }      #endif      struct mapping *merge_mappings(struct mapping *a, struct mapping *b, INT32 op)
pike.git/src/mapping.c:1872:    for(m=first_mapping;m;m=next)    {    check_mapping_for_destruct(m);    if(gc_do_free(m))    {    add_ref(m);    unlink_mapping_data(m->data);    m->data=&empty_data;    m->data->refs++;    next=m->next; + #ifdef PIKE_DEBUG +  m->debug_size=0; + #endif       free_mapping(m);    }    else if(m->flags & MAPPING_FLAG_WEAK)    {    add_ref(m);    md=m->data;    /* no locking required (no is_eq) */    for(e=0;e<md->hashsize;e++)    {
pike.git/src/mapping.c:1901:    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 -  m->debug_size++; +  m->debug_size--;   #endif    }else{    prev=&k->next;    }    }    }    if(MAP_SLOTS(md->size) < md->hashsize * MIN_LINK_LENGTH)    {    debug_malloc_touch(m);    rehash(m, MAP_SLOTS(md->size));