Lines Matching refs:bucket

177     HashBucketPtr bucket;  in drmHashDestroy()  local
184 for (bucket = table->buckets[i]; bucket;) { in drmHashDestroy()
185 next = bucket->next; in drmHashDestroy()
186 HASH_FREE(bucket); in drmHashDestroy()
187 bucket = next; in drmHashDestroy()
202 HashBucketPtr bucket; in HashFind() local
206 for (bucket = table->buckets[hash]; bucket; bucket = bucket->next) { in HashFind()
207 if (bucket->key == key) { in HashFind()
210 prev->next = bucket->next; in HashFind()
211 bucket->next = table->buckets[hash]; in HashFind()
212 table->buckets[hash] = bucket; in HashFind()
217 return bucket; in HashFind()
219 prev = bucket; in HashFind()
228 HashBucketPtr bucket; in drmHashLookup() local
232 bucket = HashFind(table, key, NULL); in drmHashLookup()
233 if (!bucket) return 1; /* Not found */ in drmHashLookup()
234 *value = bucket->value; in drmHashLookup()
241 HashBucketPtr bucket; in drmHashInsert() local
248 bucket = HASH_ALLOC(sizeof(*bucket)); in drmHashInsert()
249 if (!bucket) return -1; /* Error */ in drmHashInsert()
250 bucket->key = key; in drmHashInsert()
251 bucket->value = value; in drmHashInsert()
252 bucket->next = table->buckets[hash]; in drmHashInsert()
253 table->buckets[hash] = bucket; in drmHashInsert()
255 printf("Inserted %d at %d/%p\n", key, hash, bucket); in drmHashInsert()
264 HashBucketPtr bucket; in drmHashDelete() local
268 bucket = HashFind(table, key, &hash); in drmHashDelete()
270 if (!bucket) return 1; /* Not found */ in drmHashDelete()
272 table->buckets[hash] = bucket->next; in drmHashDelete()
273 HASH_FREE(bucket); in drmHashDelete()
315 static int count_entries(HashBucketPtr bucket) in count_entries() argument
319 for (; bucket; bucket = bucket->next) ++count; in count_entries()
332 HashBucketPtr bucket; in compute_dist() local
338 bucket = table->buckets[i]; in compute_dist()
339 update_dist(count_entries(bucket)); in compute_dist()