/[emacs]/emacs/src/fns.c
ViewVC logotype

Diff of /emacs/src/fns.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.345 by teirllm, Wed Nov 12 17:05:37 2003 UTC revision 1.346 by monnier, Mon Nov 17 23:29:49 2003 UTC
# Line 4274  hashfn_eq (h, key) Line 4274  hashfn_eq (h, key)
4274       Lisp_Object key;       Lisp_Object key;
4275  {  {
4276    unsigned hash = XUINT (key) ^ XGCTYPE (key);    unsigned hash = XUINT (key) ^ XGCTYPE (key);
4277    xassert ((hash & ~VALMASK) == 0);    xassert ((hash & ~INTMASK) == 0);
4278    return hash;    return hash;
4279  }  }
4280    
# Line 4293  hashfn_eql (h, key) Line 4293  hashfn_eql (h, key)
4293      hash = sxhash (key, 0);      hash = sxhash (key, 0);
4294    else    else
4295      hash = XUINT (key) ^ XGCTYPE (key);      hash = XUINT (key) ^ XGCTYPE (key);
4296    xassert ((hash & ~VALMASK) == 0);    xassert ((hash & ~INTMASK) == 0);
4297    return hash;    return hash;
4298  }  }
4299    
# Line 4308  hashfn_equal (h, key) Line 4308  hashfn_equal (h, key)
4308       Lisp_Object key;       Lisp_Object key;
4309  {  {
4310    unsigned hash = sxhash (key, 0);    unsigned hash = sxhash (key, 0);
4311    xassert ((hash & ~VALMASK) == 0);    xassert ((hash & ~INTMASK) == 0);
4312    return hash;    return hash;
4313  }  }
4314    
# Line 4495  maybe_resize_hash_table (h) Line 4495  maybe_resize_hash_table (h)
4495        index_size = next_almost_prime ((int)        index_size = next_almost_prime ((int)
4496                                        (new_size                                        (new_size
4497                                         / XFLOATINT (h->rehash_threshold)));                                         / XFLOATINT (h->rehash_threshold)));
4498        if (max (index_size, 2 * new_size) & ~VALMASK)        if (max (index_size, 2 * new_size) > MOST_POSITIVE_FIXNUM)
4499          error ("Hash table too large to resize");          error ("Hash table too large to resize");
4500    
4501        h->key_and_value = larger_vector (h->key_and_value, 2 * new_size, Qnil);        h->key_and_value = larger_vector (h->key_and_value, 2 * new_size, Qnil);
# Line 4585  hash_put (h, key, value, hash) Line 4585  hash_put (h, key, value, hash)
4585  {  {
4586    int start_of_bucket, i;    int start_of_bucket, i;
4587    
4588    xassert ((hash & ~VALMASK) == 0);    xassert ((hash & ~INTMASK) == 0);
4589    
4590    /* Increment count after resizing because resizing may fail.  */    /* Increment count after resizing because resizing may fail.  */
4591    maybe_resize_hash_table (h);    maybe_resize_hash_table (h);
# Line 4870  sxhash_string (ptr, len) Line 4870  sxhash_string (ptr, len)
4870        hash = ((hash << 3) + (hash >> 28) + c);        hash = ((hash << 3) + (hash >> 28) + c);
4871      }      }
4872    
4873    return hash & VALMASK;    return hash & INTMASK;
4874  }  }
4875    
4876    
# Line 4938  sxhash_bool_vector (vec) Line 4938  sxhash_bool_vector (vec)
4938    
4939    
4940  /* Return a hash code for OBJ.  DEPTH is the current depth in the Lisp  /* Return a hash code for OBJ.  DEPTH is the current depth in the Lisp
4941     structure.  Value is an unsigned integer clipped to VALMASK.  */     structure.  Value is an unsigned integer clipped to INTMASK.  */
4942    
4943  unsigned  unsigned
4944  sxhash (obj, depth)  sxhash (obj, depth)
# Line 5002  sxhash (obj, depth) Line 5002  sxhash (obj, depth)
5002        abort ();        abort ();
5003      }      }
5004    
5005    return hash & VALMASK;    return hash & INTMASK;
5006  }  }
5007    
5008    

Legend:
Removed from v.1.345  
changed lines
  Added in v.1.346

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26