Lines Matching refs:hash

0 /* hash.c -- gas hash table code
23 /* This version of the hash table code is a wholescale replacement of
24 the old hash table code, which was fairly bad. This is based on
25 the hash table code in BFD, but optimized slightly for the
27 are stored in the hash table. Instead, it always stores a pointer.
28 The assembler uses the hash table mostly to store symbols, and we
29 don't need to confuse the symbol structure with a hash table
36 /* An entry in a hash table. */
39 /* Next entry for this hash code. */
43 /* Hash code. This is the full hash code, not the index into the
45 unsigned long hash;
46 /* Pointer being stored in the hash table. */
50 /* A hash table. */
53 /* The hash array. */
55 /* The number of slots in the hash table. */
57 /* An obstack for this hash table. */
71 /* The default number of entries to use when creating a hash table.
74 the --hash-size=<NUMBER> switch. */
84 /* FIXME: This function should be amalgmated with bfd/hash.c:bfd_hash_set_default_size(). */
88 /* Extend this prime list if you want more granularity of hash table size. */
105 /* Create a hash table. This return a control block. */
135 /* Delete a hash table, freeing all allocated memory. */
144 /* Look up a string in a hash table. This returns a pointer to the
147 would hold this hash entry. If PHASH is not NULL, this sets *PHASH
148 to the hash code for KEY.
151 for its hash code, to take advantage of referential locality. */
157 unsigned long hash;
169 hash = 0;
173 hash += c + (c << 17);
174 hash ^= hash >> 2;
176 hash += len + (len << 17);
177 hash ^= hash >> 2;
180 *phash = hash;
182 index = hash % table->size;
195 if (p->hash == hash)
220 /* Insert an entry into a hash table. This returns NULL on success.
223 hash table. */
230 unsigned long hash;
232 p = hash_lookup (table, key, strlen (key), &list, &hash);
242 p->hash = hash;
251 /* Insert or replace an entry in a hash table. This returns NULL on
260 unsigned long hash;
262 p = hash_lookup (table, key, strlen (key), &list, &hash);
279 p->hash = hash;
289 /* Replace an existing entry in a hash table. This returns the old
290 value stored for the entry. If the entry is not found in the hash
314 /* Find an entry in a hash table, returning its value. Returns NULL
344 /* Delete an entry from a hash table. This returns the value stored
367 ever starts deleting hash table entries in a big way, this will
373 /* Traverse a hash table. Call the function on every entry in the
374 hash table. */
391 /* Print hash table statistics on the specified file. NAME is the
392 name of the hash table, used for printing a header. */
404 fprintf (f, "%s hash statistics:\n", name);
406 fprintf (f, "\t%lu hash comparisons\n", table->hash_compares);
435 /* This test program is left over from the old hash table code. */
437 /* Number of hash tables to maintain (at once) in any testing. */
449 /* We test many hash tables at once. */
485 printf ("old hash table #=%d.\n", number);
491 printf ("address of hash table #%d control block is %xx\n",
507 printf ("# show old, select new default hash table number\n");
590 /* Determine number: what hash table to use.
598 printf (" what hash table (%d:%d) ? ", 0, TABLES - 1);
606 printf ("warning: current hash-table-#%d. has no hash-control\n", number);
612 printf ("invalid hash table number: %d\n", number);