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.65 2000/02/09 23:49:17 hubbe Exp $"); + RCSID("$Id: mapping.c,v 1.66 2000/02/15 02:41:18 grubba 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:219:    unsigned INT32 h;    struct keypair *tmp;    struct keypair *k;       if(!from) return;    mapping_rehash_backwards_evil(md,from->next);       /* unlink */    k=md->free_list;   #ifdef PIKE_DEBUG -  if(!k) fatal("Error in rehash: not enough kehypairs.\n"); +  if(!k) fatal("Error in rehash: not enough keypairs.\n");   #endif    md->free_list=k->next;       /* initialize */    *k=*from;       /* link */    h=k->hval;    h%=md->hashsize;    k->next=md->hash[h];
pike.git/src/mapping.c:251:    unsigned INT32 h;    struct keypair *tmp;    struct keypair *k;       if(!from) return;    mapping_rehash_backwards_good(md,from->next);       /* unlink */    k=md->free_list;   #ifdef PIKE_DEBUG -  if(!k) fatal("Error in rehash: not enough kehypairs.\n"); +  if(!k) fatal("Error in rehash: not enough keypairs.\n");   #endif    md->free_list=k->next;       /* initialize */    k->hval=from->hval;    assign_svalue_no_free(&k->ind, &from->ind);    assign_svalue_no_free(&k->val, &from->val);       /* link */    h=k->hval;
pike.git/src/mapping.c:285:    */   static struct mapping *rehash(struct mapping *m, int new_size)   {    struct mapping_data *md, *new_md;   #ifdef PIKE_DEBUG    INT32 tmp=m->data->size;   #endif    INT32 e;       md=m->data; +  debug_malloc_touch(md);   #ifdef PIKE_DEBUG    if(md->refs <=0)    fatal("Zero refs in mapping->data\n");       if(d_flag>1) check_mapping(m);   #endif       init_mapping(m, new_size);    debug_malloc_touch(m);    new_md=m->data;
pike.git/src/mapping.c:1288:    zipper=merge(b,ai,op);    ci=array_zip(b,ai,zipper); /* b must not be used */    cv=array_zip(b,av,zipper); /* b must not be used */    break;    case PIKE_ARRAY_OP_SUB:    zipper=merge(ai,b,op);    ci=array_zip(ai,b,zipper); /* b must not be used */    cv=array_zip(av,b,zipper); /* b must not be used */    break;    default: -  fatal("merge_mapping_array on other then AND or SUB\n"); +  fatal("merge_mapping_array on other than AND or SUB\n");    }       free_array(ai);    free_array(av);       free((char *)zipper);       m=mkmapping(ci, cv);    free_array(ci);    free_array(cv);
pike.git/src/mapping.c:1871:    struct keypair *k,**prev;    struct mapping *m,*next;    struct mapping_data *md;       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); +  md = m->data; +  /* Protect against unlink_mapping_data() recursing too far. */    m->data=&empty_data;    m->data->refs++; -  +  +  unlink_mapping_data(md);    next=m->next;   #ifdef PIKE_DEBUG    m->debug_size=0;   #endif       free_mapping(m);    }    else if(m->flags & MAPPING_FLAG_WEAK)    {    add_ref(m);