Lines Matching defs:t
114 HashTable_Find(HashTable *t, Substring key, unsigned int h)
121 t, h, (int)keyLen, key.start);
124 for (he = t->buckets[h & t->bucketsMask]; he != NULL; he = he->next) {
136 HashTable_Init(HashTable *t)
143 t->buckets = buckets;
144 t->bucketsSize = n;
145 t->numEntries = 0;
146 t->bucketsMask = n - 1;
154 HashTable_Done(HashTable *t)
156 HashEntry **buckets = t->buckets;
157 size_t i, n = t->bucketsSize;
168 free(t->buckets);
170 t->buckets = NULL;
176 HashTable_FindEntry(HashTable *t, const char *key)
180 return HashTable_Find(t, Substring_Init(key, keyEnd), h);
185 HashTable_FindValue(HashTable *t, const char *key)
187 HashEntry *he = HashTable_FindEntry(t, key);
196 HashTable_FindValueBySubstringHash(HashTable *t, Substring key, unsigned int h)
198 HashEntry *he = HashTable_Find(t, key, h);
203 HashTable_MaxChain(const HashTable *t)
206 for (b = 0; b < t->bucketsSize; b++) {
207 const HashEntry *he = t->buckets[b];
221 HashTable_Enlarge(HashTable *t)
223 unsigned int oldSize = t->bucketsSize;
224 HashEntry **oldBuckets = t->buckets;
245 t->bucketsSize = newSize;
246 t->bucketsMask = newMask;
247 t->buckets = newBuckets;
249 (void *)t, t->bucketsSize, t->numEntries, HashTable_MaxChain(t));
257 HashTable_CreateEntry(HashTable *t, const char *key, bool *out_isNew)
261 HashEntry *he = HashTable_Find(t, Substring_Init(key, keyEnd), h);
269 if (t->numEntries >= rebuildLimit * t->bucketsSize)
270 HashTable_Enlarge(t);
277 he->next = t->buckets[h & t->bucketsMask];
278 t->buckets[h & t->bucketsMask] = he;
279 t->numEntries++;
287 HashTable_Set(HashTable *t, const char *key, void *value)
289 HashEntry *he = HashTable_CreateEntry(t, key, NULL);
293 /* Delete the entry from the table, don't free the value of the entry. */
295 HashTable_DeleteEntry(HashTable *t, HashEntry *he)
297 HashEntry **ref = &t->buckets[he->hash & t->bucketsMask];
303 t->numEntries--;
313 HashTable *t = hi->table;
315 HashEntry **buckets = t->buckets;
316 unsigned int bucketsSize = t->bucketsSize;
331 HashTable_DebugStats(const HashTable *t, const char *name)
334 name, t->bucketsSize, t->numEntries, HashTable_MaxChain(t));