Changeset 1912 for trunk/src/kmk/strcache2.h
- Timestamp:
- Oct 22, 2008, 11:17:27 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/strcache2.h
r1909 r1912 33 33 34 34 #define STRCACHE2_USE_MASK 1 35 #define STRCACHE2_USE_CHAINING 136 35 37 36 /* string cache memory segment. */ … … 48 47 struct strcache2_entry 49 48 { 50 #ifdef STRCACHE2_USE_CHAINING51 49 struct strcache2_entry *next; /* Collision chain. */ 52 #endif53 50 void *user; 54 51 unsigned int hash1; 55 #ifndef STRCACHE2_USE_CHAINING56 unsigned int hash2;57 #endif58 52 unsigned int length; 59 53 }; … … 89 83 unsigned long collision_3rd_count; /* The number of 3rd level collisions. */ 90 84 unsigned int count; /* Number entries in the cache. */ 91 #ifdef STRCACHE2_USE_CHAINING92 85 unsigned int collision_count; /* Number of entries in chains. */ 93 #endif94 86 unsigned int rehash_count; /* When to rehash the table. */ 95 87 unsigned int init_size; /* The initial hash table size. */ … … 155 147 } 156 148 157 #ifndef STRCACHE2_USE_CHAINING158 /* Get the second hash value for the string. */159 MY_INLINE unsigned int160 strcache2_get_hash2 (struct strcache2 *cache, const char *str)161 {162 unsigned int hash2 = strcache2_get_entry (cache, str)->hash2;163 if (!hash2)164 hash2 = strcache2_get_hash2_fallback (cache, str);165 return hash2;166 }167 #endif168 169 149 /* Get the pointer hash value for the string. 170 150
Note:
See TracChangeset
for help on using the changeset viewer.