[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Hash-on-eq



     We have implemented a portable, efficient method for performing hash-on- 
eq upon structures: 
    1. Set up a global counter. 
    2. For each key structure that will be hashed, add an extra slot. 
    3. Each time a key structure is instantiated, the current value of the  
global counter is incremented and stored in the extra slot.  
    4. Instead of using SXHASH upon the key structure, use the accessor  
function to get the value in the extra slot.  
    As an added feature, this method will produce nearly uniform hash table  
distributions.  At the expense of introducing an extra slot per structure, you  
gain a very fast hashing function. 

David Loewenstern & Mark Silbert
<dml@nadc.arpa, silbert@nadc.arpa>