#include "config.h"#include "system.h"#include "hashtable.h"

Go to the source code of this file.
Defines | |
| #define | OBSTACK_CHUNK_SIZE 0 |
| #define | OBSTACK_CHUNK_ALLOC xmalloc |
| #define | OBSTACK_CHUNK_FREE free |
| #define | HASHSTEP(r, c) ((r) * 67 + ((c) - 113)); |
| #define | SCALE(x) |
| #define | LABEL(x) ((x) < 1024*10 ? ' ' : ((x) < 1024*1024*10 ? 'k' : 'M')) |
Functions/Subroutines | |
| static unsigned int calc_hash | PARAMS ((const unsigned char *, unsigned int)) |
| static void ht_expand | PARAMS ((hash_table *)) |
| void | gcc_obstack_init (struct obstack *obstack) |
| static unsigned int | calc_hash (unsigned char *str, unsigned int len) const |
| hash_table * | ht_create (unsigned int order) |
| void | ht_destroy (hash_table *table) |
| hashnode | ht_lookup (hash_table *table, const unsigned char *str, unsigned int len, enum ht_lookup_option insert) |
| static void | ht_expand (hash_table *table) |
| void | ht_forall (hash_table *table, ht_cb cb, const PTR v) |
| void | ht_dump_statistics (hash_table *table) |
| double | approx_sqrt (double x) |
Referenced by calc_hash(), hashf(), and rescan().
| #define LABEL | ( | x | ) | ((x) < 1024*10 ? ' ' : ((x) < 1024*1024*10 ? 'k' : 'M')) |
| #define OBSTACK_CHUNK_ALLOC xmalloc |
Definition at line 42 of file hashtable.c.
| #define OBSTACK_CHUNK_FREE free |
Definition at line 45 of file hashtable.c.
| #define OBSTACK_CHUNK_SIZE 0 |
Definition at line 38 of file hashtable.c.
| #define SCALE | ( | x | ) |
| static double approx_sqrt | ( | double | x | ) |
| static unsigned int calc_hash | ( | unsigned char * | str, | |
| unsigned int | len | |||
| ) | const [static] |
Definition at line 61 of file hashtable.c.
References HASHSTEP, n, and r.
Referenced by ht_lookup().
Definition at line 50 of file hashtable.c.
References _obstack_begin(), OBSTACK_CHUNK_ALLOC, OBSTACK_CHUNK_FREE, OBSTACK_CHUNK_SIZE, and PARAMS.
| hash_table* ht_create | ( | unsigned int | order | ) |
Definition at line 79 of file hashtable.c.
Referenced by _cpp_init_hashtable(), and init_stringpool().
| void ht_destroy | ( | hash_table * | table | ) |
| void ht_dump_statistics | ( | hash_table * | table | ) |
| static void ht_expand | ( | hash_table * | table | ) | [static] |
Definition at line 181 of file hashtable.c.
References free(), index(), p, size, and xcalloc().
Referenced by ht_lookup(), and ht_lookup_with_hash().
| void ht_forall | ( | hash_table * | table, | |
| ht_cb | cb, | |||
| const PTR | v | |||
| ) |
Definition at line 223 of file hashtable.c.
References p.
Referenced by cpp_forall_identifiers(), ggc_mark_stringpool(), and mark_ident_hash().
| hashnode ht_lookup | ( | hash_table * | table, | |
| const unsigned char * | str, | |||
| unsigned int | len, | |||
| enum ht_lookup_option | insert | |||
| ) |
Definition at line 117 of file hashtable.c.
References calc_hash(), HT_ALLOC, HT_ALLOCED, ht_expand(), HT_LEN, HT_NO_INSERT, HT_STR, index(), memcmp, node, NULL, obstack_copy0, obstack_free, and PTR.
Referenced by _cpp_interpret_identifier(), _cpp_lex_direct(), cpp_defined(), cpp_lookup(), get_identifier(), get_identifier_nocopy(), get_identifier_with_length(), lex_identifier(), maybe_get_identifier(), and parse_identifier().
| static void ht_expand PARAMS | ( | (hash_table *) | ) | [static] |
| static unsigned int calc_hash PARAMS | ( | (const unsigned char *, unsigned int) | ) | [static] |
1.5.6