pike.git / src / mapping.c

version» Context lines:

pike.git/src/mapping.c:535: Inside #if defined(PIKE_DEBUG)
   Pike_fatal("Zero refs in mapping->data\n");       if(d_flag>1) check_mapping(m);   #endif       /* NB: Code duplication from init_mapping(). */    if (hashsize & (hashsize - 1))    hashsize = find_next_power(hashsize);    if ((md->hashsize == hashsize) && (md->refs == 1)    /* FIXME: Paranoia check below; is this needed? */ - #ifndef PIKE_MAPPING_KEYPAIR_LOOP -  && md->free_list - #else -  && (md->size < md->num_keypairs) - #endif -  ) return m; +  && !MD_FULLP(md)) +  return m;       init_mapping(m, hashsize, md->flags);    debug_malloc_touch(m);    new_md=m->data;       /* This operation is now 100% atomic - no locking required */    if(md->refs>1)    {    /* good */    /* More than one reference to the md ==> We need to
pike.git/src/mapping.c:962:    return;       mi_insert:   #ifdef PIKE_DEBUG    if(m->data != md)    Pike_fatal("Wrong dataset in mapping_insert!\n");    if(d_flag>1) check_mapping(m);   #endif    free_mapping_data(md);    -  grow_md = - #ifndef PIKE_MAPPING_KEYPAIR_LOOP -  (!md->free_list) - #else /* PIKE_MAPPING_KEYPAIR_LOOP */ -  (md->size >= md->num_keypairs) - #endif /* !PIKE_MAPPING_KEYPAIR_LOOP */ -  ; +  grow_md = MD_FULLP(md);       /* We do a re-hash here instead of copying the mapping. */    if(grow_md || md->refs>1)    {    debug_malloc_touch(m);    rehash(m, md->hashsize ? md->hashsize << grow_md : AVG_LINK_LENGTH);    md=m->data;    }    h=h2 & ( md->hashsize - 1);   
pike.git/src/mapping.c:1089: Inside #if defined(PIKE_DEBUG)
  #ifdef PIKE_DEBUG    if(m->data != md)    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;    -  grow_md = - #ifndef PIKE_MAPPING_KEYPAIR_LOOP -  (!md->free_list) - #else /* PIKE_MAPPING_KEYPAIR_LOOP */ -  (md->size >= md->num_keypairs) - #endif /* !PIKE_MAPPING_KEYPAIR_LOOP */ -  ; +  grow_md = MD_FULLP(md);       /* no need to call PREPARE_* because we re-hash instead */    if(grow_md || md->refs>1)    {    debug_malloc_touch(m);    rehash(m, md->hashsize ? md->hashsize << grow_md : AVG_LINK_LENGTH);    md=m->data;    }    h=h2 & ( md->hashsize - 1);