Home | History | Annotate | Download | only in libdrm

Lines Matching refs:hash

1 /* xf86drmHash.c -- Small hash table support for integer -> integer mapping
31 * hash table using self-organizing linked lists [Knuth73, pp. 398-399] for
40 * 2) The hash computation uses a table of random integers [Hanson97,
48 * dynamic hash tables was postponed until the need arises. A common (and
49 * naive) approach to dynamic hash table implementation simply creates a
50 * new hash table when necessary, rehashes all the data into the new table,
66 * [Larson88] Per-Ake Larson. "Dynamic Hash Tables". CACM 31(4), April
131 unsigned long hash = 0;
146 hash = (hash << 1) + scatter[tmp & 0xff];
150 hash %= HASH_SIZE;
152 printf( "Hash(%d) = %d\n", key, hash);
154 return hash;
200 unsigned long hash = HashHash(key);
204 if (h) *h = hash;
206 for (bucket = table->buckets[hash]; bucket; bucket = bucket->next) {
211 bucket->next = table->buckets[hash];
212 table->buckets[hash] = bucket;
242 unsigned long hash;
246 if (HashFind(table, key, &hash)) return 1; /* Already in table */
252 bucket->next = table->buckets[hash];
253 table->buckets[hash] = bucket;
255 printf("Inserted %d at %d/%p\n", key, hash, bucket);
263 unsigned long hash;
268 bucket = HashFind(table, key, &hash);
272 table->buckets[hash] = bucket->next;