pike.git / src / mapping.c

version» Context lines:

pike.git/src/mapping.c:1:   /*\   ||| This file is part of Pike. For copyright information see COPYRIGHT.   ||| Pike is distributed under GPL, LGPL and MPL. See the file COPYING   ||| for more information.   \*/   /**/   #include "global.h" - RCSID("$Id: mapping.c,v 1.148 2002/05/31 22:41:24 nilsson Exp $"); + RCSID("$Id: mapping.c,v 1.149 2002/08/15 14:49:22 marcus Exp $");   #include "main.h"   #include "object.h"   #include "mapping.h"   #include "svalue.h"   #include "array.h"   #include "pike_macros.h"   #include "pike_error.h"   #include "pike_memory.h"   #include "dynamic_buffer.h"   #include "interpret.h"
pike.git/src/mapping.c:42:      #define MAPPING_DATA_SIZE(HSIZE, KEYPAIRS) \    (ptrdiff_t)( MD_KEYPAIRS(0, HSIZE) + KEYPAIRS )            #undef EXIT_BLOCK   #define EXIT_BLOCK(m) do{ \   DO_IF_DEBUG( \    if(m->refs) \ -  fatal("really free mapping on mapping with nonzero refs.\n"); \ +  Pike_fatal("really free mapping on mapping with nonzero refs.\n"); \   ) \    \    FREE_PROT(m); \    \    unlink_mapping_data(m->data); \    \    DOUBLEUNLINK(first_mapping, m); \    \    GC_FREE(m); \   }while(0)
pike.git/src/mapping.c:87:    md->free_list--; \    if (k != md->free_list) { \    struct keypair **prev_; \    unsigned INT32 h_; \    /* Move the last keypair to the new hole. */ \    *k = *(md->free_list); \    h_ = k->hval % md->hashsize; \    prev_ = md->hash + h_; \    DO_IF_DEBUG( \    if (!*prev_) { \ -  fatal("Node to move not found!\n"); \ +  Pike_fatal("Node to move not found!\n"); \    } \    ); \    while (*prev_ != md->free_list) { \    prev_ = &((*prev_)->next); \    DO_IF_DEBUG( \    if (!*prev_) { \ -  fatal("Node to move not found!\n"); \ +  Pike_fatal("Node to move not found!\n"); \    } \    ); \    } \    *prev_ = k; \    } \    } while(0)   #endif /* !PIKE_MAPPING_KEYPAIR_LOOP */      #ifdef PIKE_DEBUG   /* This function checks that the type field isn't lacking any bits.
pike.git/src/mapping.c:122: Inside #if defined(PIKE_DEBUG)
      ind_types=val_types=0;       MAPPING_LOOP(m)    {    val_types |= 1 << k->val.type;    ind_types |= 1 << k->ind.type;    }       if(val_types & ~(m->data->val_types)) -  fatal("Mapping value types out of order!\n"); +  Pike_fatal("Mapping value types out of order!\n");       if(ind_types & ~(m->data->ind_types)) -  fatal("Mapping indices types out of order!\n"); +  Pike_fatal("Mapping indices types out of order!\n");   }   #endif      static struct mapping_data empty_data =    { PIKE_CONSTANT_MEMOBJ_INIT(1), 1, 0,0,0,0,0,0, 0, 0,{0}};   static struct mapping_data weak_ind_empty_data =    { PIKE_CONSTANT_MEMOBJ_INIT(1), 1, 0,0,0,0,0,0, MAPPING_WEAK_INDICES, 0,{0}};   static struct mapping_data weak_val_empty_data =    { PIKE_CONSTANT_MEMOBJ_INIT(1), 1, 0,0,0,0,0,0, MAPPING_WEAK_VALUES, 0,{0}};   static struct mapping_data weak_both_empty_data =
pike.git/src/mapping.c:153:    INT32 size,    INT16 flags)   {    struct mapping_data *md;    ptrdiff_t e;    INT32 hashsize;       debug_malloc_touch(m);   #ifdef PIKE_DEBUG    if (Pike_in_gc > GC_PASS_PREPARE && Pike_in_gc < GC_PASS_ZAP_WEAK) -  fatal("Can't allocate a new mapping_data inside gc.\n"); -  if(size < 0) fatal("init_mapping with negative value.\n"); +  Pike_fatal("Can't allocate a new mapping_data inside gc.\n"); +  if(size < 0) Pike_fatal("init_mapping with negative value.\n");   #endif    if(size)    {    hashsize=find_good_hash_size(size / AVG_LINK_LENGTH + 1);       e=MAPPING_DATA_SIZE(hashsize, size);       md=(struct mapping_data *)xalloc(e);       m->data=md;
pike.git/src/mapping.c:233:         PMOD_EXPORT void really_free_mapping_data(struct mapping_data *md)   {    INT32 e;    struct keypair *k;    debug_malloc_touch(md);      #ifdef PIKE_DEBUG    if (md->refs) { -  fatal("really_free_mapping_data(): md has non-zero refs: %d\n", +  Pike_fatal("really_free_mapping_data(): md has non-zero refs: %d\n",    md->refs);    }   #endif /* PIKE_DEBUG */       NEW_MAPPING_LOOP(md)    {    free_svalue(& k->val);    free_svalue(& k->ind);    }   
pike.git/src/mapping.c:271:    unsigned INT32 h;    struct keypair *k;       if(!from) return;    mapping_rehash_backwards_evil(md,from->next);       /* unlink */    k=md->free_list;   #ifndef PIKE_MAPPING_KEYPAIR_LOOP   #ifdef PIKE_DEBUG -  if(!k) fatal("Error in rehash: not enough keypairs.\n"); +  if(!k) Pike_fatal("Error in rehash: not enough keypairs.\n");   #endif    md->free_list=k->next;   #else /* PIKE_MAPPING_KEYPAIR_LOOP */    md->free_list++;   #endif /* !PIKE_MAPPING_KEYPAIR_LOOP */       /* initialize */    *k=*from;       /* link */
pike.git/src/mapping.c:306:    unsigned INT32 h;    struct keypair *k;       if(!from) return;    mapping_rehash_backwards_good(md,from->next);       /* unlink */    k=md->free_list;   #ifndef PIKE_MAPPING_KEYPAIR_LOOP   #ifdef PIKE_DEBUG -  if(!k) fatal("Error in rehash: not enough keypairs.\n"); +  if(!k) Pike_fatal("Error in rehash: not enough keypairs.\n");   #endif    md->free_list=k->next;   #else /* PIKE_MAPPING_KEYPAIR_LOOP */    md->free_list++;   #endif /* !PIKE_MAPPING_KEYPAIR_LOOP */       /* initialize */    k->hval=from->hval;    assign_svalue_no_free(&k->ind, &from->ind);    assign_svalue_no_free(&k->val, &from->val);
pike.git/src/mapping.c:346: Inside #if defined(PIKE_DEBUG)
   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"); +  Pike_fatal("Zero refs in mapping->data\n");       if(d_flag>1) check_mapping(m);   #endif       init_mapping(m, new_size, md->flags);    debug_malloc_touch(m);    new_md=m->data;       /* This operation is now 100% atomic - no locking required */    if(md->refs>1)
pike.git/src/mapping.c:374:    /* evil */    for(e=0;e<md->hashsize;e++)    mapping_rehash_backwards_evil(new_md, md->hash[e]);       free((char *)md);    GC_FREE_BLOCK(md);    }      #ifdef PIKE_DEBUG    if(m->data->size != tmp) -  fatal("Rehash failed, size not same any more.\n"); +  Pike_fatal("Rehash failed, size not same any more.\n");   #endif   #ifdef MAPPING_SIZE_DEBUG    m->debug_size = m->data->size;   #endif      #ifdef PIKE_DEBUG    if(d_flag>1) check_mapping(m);   #endif       return m;
pike.git/src/mapping.c:403:      struct mapping_data *copy_mapping_data(struct mapping_data *md)   {    long e;    ptrdiff_t size, off;    struct mapping_data *nmd;    struct keypair *keypairs;      #ifdef PIKE_DEBUG    if (Pike_in_gc > GC_PASS_PREPARE && Pike_in_gc < GC_PASS_ZAP_WEAK) -  fatal("Can't allocate a new mapping_data inside gc.\n"); +  Pike_fatal("Can't allocate a new mapping_data inside gc.\n");   #endif       debug_malloc_touch(md);       size=MAPPING_DATA_SIZE(md->hashsize, md->num_keypairs);       nmd=(struct mapping_data *)xalloc(size);    MEMCPY(nmd, md, size);    off=((char *)nmd) - ((char *)md);   
pike.git/src/mapping.c:442:   #endif /* PIKE_MAPPING_KEYPAIR_LOOP */       nmd->refs=1;    nmd->valrefs=0;    nmd->hardlinks=0;       if(md->hardlinks)    {   #ifdef PIKE_DEBUG    if(md->refs <= 0 || md->valrefs<=0) -  fatal("Hardlink without refs/valrefs!\n"); +  Pike_fatal("Hardlink without refs/valrefs!\n");   #endif    md->hardlinks--;    md->valrefs--;    }    md->refs--;       return nmd;   }      #define MAPPING_DATA_IN_USE(MD) ((MD)->refs != (MD)->hardlinks + 1)
pike.git/src/mapping.c:593:    val_types = ind_types = 0;       NEW_MAPPING_LOOP(m->data)    {    val_types |= 1 << k->val.type;    ind_types |= 1 << k->ind.type;    }      #ifdef PIKE_DEBUG    if(val_types & ~(m->data->val_types)) -  fatal("Mapping value types out of order!\n"); +  Pike_fatal("Mapping value types out of order!\n");       if(ind_types & ~(m->data->ind_types)) -  fatal("Mapping indices types out of order!\n"); +  Pike_fatal("Mapping indices types out of order!\n");   #endif    m->data->val_types = val_types;    m->data->ind_types = ind_types;   }      PMOD_EXPORT void mapping_set_flags(struct mapping *m, int flags)   {    struct mapping_data *md = m->data;    if (md->refs > 1) {    struct keypair *k = NULL, *prev = NULL;
pike.git/src/mapping.c:639:    struct svalue *key,    struct svalue *val,    int overwrite)   {    unsigned INT32 h,h2;    struct keypair *k, **prev;    struct mapping_data *md, *omd;      #ifdef PIKE_DEBUG    if(m->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");   #endif       h2=hash_svalue(key);      #ifdef PIKE_DEBUG    if(d_flag>1) check_mapping(m);   #endif       LOW_FIND(is_eq, key,    struct svalue *tmp=&k->ind;
pike.git/src/mapping.c:673:    free_mapping_data(omd);    goto Z)));       mi_do_nothing:    free_mapping_data(md);    return;       mi_set_value:   #ifdef PIKE_DEBUG    if(m->data != md) -  fatal("Wrong dataset in mapping_insert!\n"); +  Pike_fatal("Wrong dataset in mapping_insert!\n");    if(d_flag>1) check_mapping(m);   #endif    free_mapping_data(md);    if(!overwrite) return;    PREPARE_FOR_DATA_CHANGE2();    PROPAGATE(); /* propagate after preparing */    md->val_types |= 1 << val->type;    assign_svalue(& k->val, val);   #ifdef PIKE_DEBUG    if(d_flag>1) check_mapping(m);   #endif    return;       mi_insert:   #ifdef PIKE_DEBUG    if(m->data != md) -  fatal("Wrong dataset in mapping_insert!\n"); +  Pike_fatal("Wrong dataset in mapping_insert!\n");    if(d_flag>1) check_mapping(m);   #endif    free_mapping_data(md);    /* We do a re-hash here instead of copying the mapping. */    if(   #ifndef PIKE_MAPPING_KEYPAIR_LOOP    (!md->free_list) ||   #else /* PIKE_MAPPING_KEYPAIR_LOOP */    (md->size >= md->num_keypairs) ||   #endif /* !PIKE_MAPPING_KEYPAIR_LOOP */
pike.git/src/mapping.c:752:   PMOD_EXPORT union anything *mapping_get_item_ptr(struct mapping *m,    struct svalue *key,    TYPE_T t)   {    unsigned INT32 h, h2;    struct keypair *k, **prev;    struct mapping_data *md,*omd;      #ifdef PIKE_DEBUG    if(m->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");       if(d_flag>1) check_mapping(m);       debug_malloc_touch(m);    debug_malloc_touch(m->data);   #endif       h2=hash_svalue(key);       LOW_FIND(is_eq, key,
pike.git/src/mapping.c:789:             mg_do_nothing:    free_mapping_data(md);    return 0;       mg_set_value:   #ifdef PIKE_DEBUG    if(m->data != md) -  fatal("Wrong dataset in mapping_get_item_ptr!\n"); +  Pike_fatal("Wrong dataset in mapping_get_item_ptr!\n");    if(d_flag)    check_mapping(m);   #endif    free_mapping_data(md);    if(k->val.type == t)    {    PREPARE_FOR_DATA_CHANGE2();    PROPAGATE(); /* prepare then propagate */       return & ( k->val.u );    }       return 0;       mg_insert:   #ifdef PIKE_DEBUG    if(m->data != md) -  fatal("Wrong dataset in mapping_get_item_ptr!\n"); +  Pike_fatal("Wrong dataset in mapping_get_item_ptr!\n");    if(d_flag)    check_mapping(m);   #endif    free_mapping_data(md);       if(t != T_INT) return 0;       /* no need to call PREPARE_* because we re-hash instead */    if(   #ifndef PIKE_MAPPING_KEYPAIR_LOOP
pike.git/src/mapping.c:868:   PMOD_EXPORT void map_delete_no_free(struct mapping *m,    struct svalue *key,    struct svalue *to)   {    unsigned INT32 h,h2;    struct keypair *k, **prev;    struct mapping_data *md,*omd;      #ifdef PIKE_DEBUG    if(m->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");    if(d_flag>1) check_mapping(m);    debug_malloc_touch(m);   #endif       h2=hash_svalue(key);       LOW_FIND(is_eq, key,    struct svalue *tmp=&k->ind;    SAME_DATA(goto md_remove_value,    omd=md;
pike.git/src/mapping.c:900:    {    to->type=T_INT;    to->subtype=NUMBER_UNDEFINED;    to->u.integer=0;    }    return;       md_remove_value:   #ifdef PIKE_DEBUG    if(md->refs <= 1) -  fatal("Too few refs i mapping->data\n"); +  Pike_fatal("Too few refs i mapping->data\n");    if(m->data != md) -  fatal("Wrong dataset in mapping_delete!\n"); +  Pike_fatal("Wrong dataset in mapping_delete!\n");    if(d_flag>1) check_mapping(m);    debug_malloc_touch(m);   #endif    free_mapping_data(md);    PREPARE_FOR_INDEX_CHANGE2();    /* No need to propagate */    *prev=k->next;    free_svalue(& k->ind);    if(to)    to[0]=k->val;
pike.git/src/mapping.c:948:      PMOD_EXPORT void check_mapping_for_destruct(struct mapping *m)   {    INT32 e;    struct keypair *k, **prev;    TYPE_FIELD ind_types, val_types;    struct mapping_data *md=m->data;      #ifdef PIKE_DEBUG    if(m->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");    if(d_flag>1) check_mapping(m);    debug_malloc_touch(m);    if (Pike_in_gc > GC_PASS_PREPARE && Pike_in_gc < GC_PASS_FREE) -  fatal("check_mapping_for_destruct called in invalid pass inside gc.\n"); +  Pike_fatal("check_mapping_for_destruct called in invalid pass inside gc.\n");   #endif       /* no is_eq -> no locking */       if(!md->size) return;       if((md->ind_types | md->val_types) & (BIT_OBJECT | BIT_FUNCTION))    {    val_types = ind_types = 0;    md->val_types |= BIT_INT;
pike.git/src/mapping.c:1022:      PMOD_EXPORT struct svalue *low_mapping_lookup(struct mapping *m,    struct svalue *key)   {    unsigned INT32 h,h2;    struct keypair *k=0, **prev=0;    struct mapping_data *md, *omd;      #ifdef PIKE_DEBUG    if(m->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");    if(d_flag>1) check_mapping(m);   #endif       h2=hash_svalue(key);   #ifdef PIKE_DEBUG    if(d_flag > 1) check_mapping_type_fields(m);   #endif    FIND();    if(k)    {
pike.git/src/mapping.c:1089:    struct svalue *key2,    int create)   {    struct svalue tmp;    struct mapping *m2;    struct svalue *s=low_mapping_lookup(m, key1);    debug_malloc_touch(m);      #ifdef PIKE_DEBUG    if(m->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");   #endif       if(!s || !s->type==T_MAPPING)    {    if(!create) return 0;    tmp.u.mapping=allocate_mapping(5);    tmp.type=T_MAPPING;    mapping_insert(m, key1, &tmp);    debug_malloc_touch(m);    debug_malloc_touch(tmp.u.mapping);
pike.git/src/mapping.c:1164:      PMOD_EXPORT struct array *mapping_indices(struct mapping *m)   {    INT32 e;    struct array *a;    struct svalue *s;    struct keypair *k;      #ifdef PIKE_DEBUG    if(m->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");   #endif       check_mapping_for_destruct(m);       a=allocate_array(m->data->size);    s=ITEM(a);       /* no locking required */    NEW_MAPPING_LOOP(m->data) assign_svalue(s++, & k->ind);   
pike.git/src/mapping.c:1193:      PMOD_EXPORT struct array *mapping_values(struct mapping *m)   {    INT32 e;    struct keypair *k;    struct array *a;    struct svalue *s;      #ifdef PIKE_DEBUG    if(m->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");   #endif       check_mapping_for_destruct(m);       a=allocate_array(m->data->size);    s=ITEM(a);       /* no locking required */    NEW_MAPPING_LOOP(m->data) assign_svalue(s++, & k->val);   
pike.git/src/mapping.c:1222:      PMOD_EXPORT struct array *mapping_to_array(struct mapping *m)   {    INT32 e;    struct keypair *k;    struct array *a;    struct svalue *s;      #ifdef PIKE_DEBUG    if(m->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");   #endif       a=allocate_array(m->data->size);    s=ITEM(a);       /* no locking required */    NEW_MAPPING_LOOP(m->data)    {    struct array *b=allocate_array(2);    assign_svalue(b->item+0, & k->ind);
pike.git/src/mapping.c:1251:   }      PMOD_EXPORT void mapping_replace(struct mapping *m,struct svalue *from, struct svalue *to)   {    INT32 e;    struct keypair *k;    struct mapping_data *md;      #ifdef PIKE_DEBUG    if(m->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");   #endif       md=m->data;    if(md->size)    {    add_ref(md);    NEW_MAPPING_LOOP(md)    {    if(is_eq(& k->val, from))    {
pike.git/src/mapping.c:1283:   }      PMOD_EXPORT struct mapping *mkmapping(struct array *ind, struct array *val)   {    struct mapping *m;    struct svalue *i,*v;    INT32 e;      #ifdef PIKE_DEBUG    if(ind->size != val->size) -  fatal("mkmapping on different sized arrays.\n"); +  Pike_fatal("mkmapping on different sized arrays.\n");   #endif       m=allocate_mapping(MAP_SLOTS(ind->size));    i=ITEM(ind);    v=ITEM(val);    for(e=0;e<ind->size;e++) mapping_insert(m, i++, v++);       return m;   }   
pike.git/src/mapping.c:1322:   }   #else      /* deferred mapping copy! */   PMOD_EXPORT struct mapping *copy_mapping(struct mapping *m)   {    struct mapping *n;      #ifdef PIKE_DEBUG    if(m->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_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 MAPPING_SIZE_DEBUG    n->debug_size=n->data->size;   #endif
pike.git/src/mapping.c:1353:   {    ONERROR r1,r2,r3,r4;    struct array *ai, *av;    struct array *bi, *bv;    struct array *ci, *cv;    INT32 *zipper;    struct mapping *m;      #ifdef PIKE_DEBUG    if(a->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");    if(b->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");   #endif       ai=mapping_indices(a);    SET_ONERROR(r1,do_free_array,ai);       av=mapping_values(a);    SET_ONERROR(r2,do_free_array,av);       if(ai->size > 1)    {
pike.git/src/mapping.c:1441:    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 than AND or SUB\n"); +  Pike_fatal("merge_mapping_array on other than AND or SUB\n");    }       UNSET_ONERROR(r2); free_array(av);    UNSET_ONERROR(r1); free_array(ai);       free((char *)zipper);       m=mkmapping(ci, cv);    free_array(ci);    free_array(cv);
pike.git/src/mapping.c:1534:    struct mapping *m=argp[d].u.mapping;    struct mapping_data *md=m->data;       add_ref(md);    NEW_MAPPING_LOOP(md)    mapping_insert(ret, &k->ind, &k->val);    free_mapping_data(md);    }   #ifdef PIKE_DEBUG    if(!ret) -  fatal("add_mappings is confused!\n"); +  Pike_fatal("add_mappings is confused!\n");   #endif    return ret;   }      PMOD_EXPORT int mapping_equal_p(struct mapping *a, struct mapping *b, struct processing *p)   {    struct processing curr;    struct keypair *k;    struct mapping_data *md;    INT32 e,eq=1;      #ifdef PIKE_DEBUG    if(a->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");    if(b->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");   #endif       if(a==b) return 1;       check_mapping_for_destruct(a);    check_mapping_for_destruct(b);       if(m_sizeof(a) != m_sizeof(b)) return 0;       curr.pointer_a = a;
pike.git/src/mapping.c:1630:   {    struct processing doing;    struct array *a;    JMP_BUF catch;    ONERROR err;    INT32 e,d;    char buf[40];      #ifdef PIKE_DEBUG    if(m->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");   #endif       if(! m->data->size)    {    my_strcat("([ ])");    return;    }       doing.next=p;    doing.pointer_a=(void *)m;
pike.git/src/mapping.c:1747:    }       UNSET_ONERROR(err);    free_array(a);   }      node *make_node_from_mapping(struct mapping *m)   {   #ifdef PIKE_DEBUG    if(m->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");   #endif       mapping_fix_type_field(m);       if(!mapping_is_constant(m,0))    {    struct array *ind, *val;    node *n;    ind=mapping_indices(m);    val=mapping_values(m);
pike.git/src/mapping.c:1819:    struct processing *p)   {    struct processing doing;    struct mapping *ret;    INT32 e;    struct keypair *k;    struct mapping_data *md;      #ifdef PIKE_DEBUG    if(m->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");   #endif       doing.next=p;    doing.pointer_a=(void *)m;    for(;p;p=p->next)    {    if(p->pointer_a == (void *)m)    {    add_ref(ret=(struct mapping *)p->pointer_b);    return ret;
pike.git/src/mapping.c:1876:      PMOD_EXPORT void mapping_search_no_free(struct svalue *to,    struct mapping *m,    struct svalue *look_for,    struct svalue *key /* start */)   {    struct mapping_data *md, *omd;      #ifdef PIKE_DEBUG    if(m->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");   #endif    md=m->data;       if(md->size)    {    unsigned INT32 h2,h=0;    struct keypair *k=md->hash[0], **prev;       if(key)    {
pike.git/src/mapping.c:1957: Inside #if defined(PIKE_DEBUG)
   struct keypair *k;    struct mapping_data *md;       static int in_check_mapping;    if(in_check_mapping) return;    in_check_mapping=1;       md=m->data;       if(m->refs <=0) -  fatal("Mapping has zero refs.\n"); +  Pike_fatal("Mapping has zero refs.\n");       if(!m->data) -  fatal("Mapping has no data block.\n"); +  Pike_fatal("Mapping has no data block.\n");       if (!m->data->refs) -  fatal("Mapping data block has zero refs.\n"); +  Pike_fatal("Mapping data block has zero refs.\n");       if(m->next && m->next->prev != m) -  fatal("Mapping ->next->prev != mapping.\n"); +  Pike_fatal("Mapping ->next->prev != mapping.\n");      #ifdef MAPPING_SIZE_DEBUG    if(m->debug_size != md->size)    {    if(Pike_in_gc)    {    fprintf(stderr,"Pike was in GC stage %d when this fatal occured:\n",Pike_in_gc);    Pike_in_gc=0;    }       fprintf(stderr,"--MAPPING ZAPPING (%d!=%d), mapping:\n",m->debug_size,md->size);    describe(m);    fprintf(stderr,"--MAPPING ZAPPING (%d!=%d), mapping data:\n",m->debug_size,md->size);    describe(md); -  fatal("Mapping zapping detected (%d != %d)!\n",m->debug_size,md->size); +  Pike_fatal("Mapping zapping detected (%d != %d)!\n",m->debug_size,md->size);    }   #endif       if(m->prev)    {    if(m->prev->next != m) -  fatal("Mapping ->prev->next != mapping.\n"); +  Pike_fatal("Mapping ->prev->next != mapping.\n");    }else{    if(first_mapping != m) -  fatal("Mapping ->prev == 0 but first_mapping != mapping.\n"); +  Pike_fatal("Mapping ->prev == 0 but first_mapping != mapping.\n");    }       if(md->valrefs <0) -  fatal("md->valrefs < 0\n"); +  Pike_fatal("md->valrefs < 0\n");       if(md->hardlinks <0) -  fatal("md->valrefs < 0\n"); +  Pike_fatal("md->valrefs < 0\n");       if(md->refs < md->valrefs+1) -  fatal("md->refs < md->valrefs+1\n"); +  Pike_fatal("md->refs < md->valrefs+1\n");       if(md->valrefs < md->hardlinks) -  fatal("md->refs < md->valrefs+1\n"); +  Pike_fatal("md->refs < md->valrefs+1\n");       if(md->hashsize < 0) -  fatal("Assert: I don't think he's going to make it Jim.\n"); +  Pike_fatal("Assert: I don't think he's going to make it Jim.\n");       if(md->size < 0) -  fatal("Core breach, evacuate ship!\n"); +  Pike_fatal("Core breach, evacuate ship!\n");       if(md->num_keypairs < 0) -  fatal("Starboard necell on fire!\n"); +  Pike_fatal("Starboard necell on fire!\n");       if(md->size > md->num_keypairs) -  fatal("Pretty mean hashtable there buster!\n"); +  Pike_fatal("Pretty mean hashtable there buster!\n");       if(md->hashsize > md->num_keypairs) -  fatal("Pretty mean hashtable there buster %d > %d (2)!\n",md->hashsize,md->num_keypairs); +  Pike_fatal("Pretty mean hashtable there buster %d > %d (2)!\n",md->hashsize,md->num_keypairs);       if(md->num_keypairs > (md->hashsize + 3) * AVG_LINK_LENGTH) -  fatal("Mapping from hell detected, attempting to send it back...\n"); +  Pike_fatal("Mapping from hell detected, attempting to send it back...\n");       if(md->size > 0 && (!md->ind_types || !md->val_types)) -  fatal("Mapping type fields are... wrong.\n"); +  Pike_fatal("Mapping type fields are... wrong.\n");       num=0;    NEW_MAPPING_LOOP(md)    {    num++;       if(! ( (1 << k->ind.type) & (md->ind_types) )) -  fatal("Mapping indices type field lies.\n"); +  Pike_fatal("Mapping indices type field lies.\n");       if(! ( (1 << k->val.type) & (md->val_types) )) -  fatal("Mapping values type field lies.\n"); +  Pike_fatal("Mapping values type field lies.\n");       check_svalue(& k->ind);    check_svalue(& k->val);       /* FIXME add check for k->hval    * beware that hash_svalue may be threaded and locking    * is required!!    */    }       if(md->size != num) -  fatal("Shields are failing, hull integrity down to 20%%\n"); +  Pike_fatal("Shields are failing, hull integrity down to 20%%\n");       in_check_mapping=0;   }      void check_all_mappings(void)   {    struct mapping *m;    for(m=first_mapping;m;m=m->next)    check_mapping(m);   }
pike.git/src/mapping.c:2073:   #else   #define DO_IF_MAPPING_SIZE_DEBUG(x)   #endif      #define GC_RECURSE_MD_IN_USE(MD, RECURSE_FN, IND_TYPES, VAL_TYPES) do { \    INT32 e; \    struct keypair *k; \    IND_TYPES = MD->ind_types; \    NEW_MAPPING_LOOP(MD) { \    if (!IS_DESTRUCTED(&k->ind) && RECURSE_FN(&k->ind, 1)) { \ -  DO_IF_DEBUG(fatal("Didn't expect an svalue zapping now.\n")); \ +  DO_IF_DEBUG(Pike_fatal("Didn't expect an svalue zapping now.\n")); \    } \    RECURSE_FN(&k->val, 1); \    VAL_TYPES |= 1 << k->val.type; \    } \   } while (0)      #define GC_RECURSE(MD, REC_KEYPAIR, TYPE, IND_TYPES, VAL_TYPES) do { \    INT32 e; \    int remove; \    struct keypair *k,**prev; \
pike.git/src/mapping.c:2150:    else if ((REMOVE = W_REC(&k->val, 1))) \    gc_free_svalue(&k->ind); \    else \    W_REC(&k->ind, 1); /* Now we can recurse the index. */ \   } while (0)      void gc_mark_mapping_as_referenced(struct mapping *m)   {   #ifdef PIKE_DEBUG    if(m->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");   #endif    debug_malloc_touch(m);    debug_malloc_touch(m->data);       if(gc_mark(m)) {    struct mapping_data *md = m->data;       if (m == gc_mark_mapping_pos)    gc_mark_mapping_pos = m->next;    if (m == gc_internal_mapping)
pike.git/src/mapping.c:2208:      void real_gc_cycle_check_mapping(struct mapping *m, int weak)   {    GC_CYCLE_ENTER(m, weak) {    struct mapping_data *md = m->data;    debug_malloc_touch(m);    debug_malloc_touch(md);      #ifdef PIKE_DEBUG    if(md->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");   #endif       if ((md->ind_types | md->val_types) & BIT_COMPLEX) {    TYPE_FIELD ind_types = 0, val_types = 0;    if (MAPPING_DATA_IN_USE(md)) {    /* Must leave the mapping data untouched if it's busy. */    debug_malloc_touch(m);    debug_malloc_touch(md);    GC_RECURSE_MD_IN_USE(md, gc_cycle_check_svalues, ind_types, val_types);    gc_assert_checked_as_nonweak(md);
pike.git/src/mapping.c:2308:    }    }   }      #ifdef PIKE_DEBUG   unsigned gc_touch_all_mappings(void)   {    unsigned n = 0;    struct mapping *m;    if (first_mapping && first_mapping->prev) -  fatal("Error in mapping link list.\n"); +  Pike_fatal("Error in mapping link list.\n");    for (m = first_mapping; m; m = m->next) {    debug_gc_touch(m);    n++;    if (m->next && m->next->prev != m) -  fatal("Error in mapping link list.\n"); +  Pike_fatal("Error in mapping link list.\n");    }    return n;   }   #endif      void gc_check_all_mappings(void)   {    struct mapping *m;       for(m=first_mapping;m;m=m->next)    {   #ifdef DEBUG_MALLOC    if (((int)m->data) == 0x55555555) {    fprintf(stderr, "** Zapped mapping in list of active mappings!\n");    describe_something(m, T_MAPPING, 0,2,0, NULL); -  fatal("Zapped mapping in list of active mappings!\n"); +  Pike_fatal("Zapped mapping in list of active mappings!\n");    }   #endif /* DEBUG_MALLOC */       gc_check_mapping(m);   #ifdef PIKE_DEBUG    if(d_flag > 1) check_mapping_type_fields(m);   #endif    }   }