
Macros | |
| #define | list_elem_to_hash_elem(LIST_ELEM) list_entry(LIST_ELEM, struct hash_elem, list_elem) |
| #define | FNV_64_PRIME 0x00000100000001B3UL |
| #define | FNV_64_BASIS 0xcbf29ce484222325UL |
| #define | MIN_ELEMS_PER_BUCKET 1 /* Elems/bucket < 1: reduce # of buckets. */ |
| #define | BEST_ELEMS_PER_BUCKET 2 /* Ideal elems/bucket. */ |
| #define | MAX_ELEMS_PER_BUCKET 4 /* Elems/bucket > 4: increase # of buckets. */ |
Functions | |
| static struct list * | find_bucket (struct hash *, struct hash_elem *) |
| static struct hash_elem * | find_elem (struct hash *, struct list *, struct hash_elem *) |
| static void | insert_elem (struct hash *, struct list *, struct hash_elem *) |
| static void | remove_elem (struct hash *, struct hash_elem *) |
| static void | rehash (struct hash *) |
| bool | hash_init (struct hash *h, hash_hash_func *hash, hash_less_func *less, void *aux) |
| void | hash_clear (struct hash *h, hash_action_func *destructor) |
| void | hash_destroy (struct hash *h, hash_action_func *destructor) |
| struct hash_elem * | hash_insert (struct hash *h, struct hash_elem *new) |
| struct hash_elem * | hash_replace (struct hash *h, struct hash_elem *new) |
| struct hash_elem * | hash_find (struct hash *h, struct hash_elem *e) |
| struct hash_elem * | hash_delete (struct hash *h, struct hash_elem *e) |
| void | hash_apply (struct hash *h, hash_action_func *action) |
| void | hash_first (struct hash_iterator *i, struct hash *h) |
| struct hash_elem * | hash_next (struct hash_iterator *i) |
| struct hash_elem * | hash_cur (struct hash_iterator *i) |
| size_t | hash_size (struct hash *h) |
| bool | hash_empty (struct hash *h) |
| uint64_t | hash_bytes (const void *buf_, size_t size) |
| uint64_t | hash_string (const char *s_) |
| uint64_t | hash_int (int i) |
| static size_t | turn_off_least_1bit (size_t x) |
| static size_t | is_power_of_2 (size_t x) |
| #define BEST_ELEMS_PER_BUCKET 2 /* Ideal elems/bucket. */ |
| #define FNV_64_BASIS 0xcbf29ce484222325UL |
| #define FNV_64_PRIME 0x00000100000001B3UL |
| #define list_elem_to_hash_elem | ( | LIST_ELEM | ) | list_entry(LIST_ELEM, struct hash_elem, list_elem) |
| #define MAX_ELEMS_PER_BUCKET 4 /* Elems/bucket > 4: increase # of buckets. */ |
| #define MIN_ELEMS_PER_BUCKET 1 /* Elems/bucket < 1: reduce # of buckets. */ |


|
static |


| void hash_apply | ( | struct hash * | h, |
| hash_action_func * | action | ||
| ) |


| void hash_clear | ( | struct hash * | h, |
| hash_action_func * | destructor | ||
| ) |
| struct hash_elem * hash_cur | ( | struct hash_iterator * | i | ) |



| void hash_destroy | ( | struct hash * | h, |
| hash_action_func * | destructor | ||
| ) |




| void hash_first | ( | struct hash_iterator * | i, |
| struct hash * | h | ||
| ) |


| bool hash_init | ( | struct hash * | h, |
| hash_hash_func * | hash, | ||
| hash_less_func * | less, | ||
| void * | aux | ||
| ) |




| uint64_t hash_int | ( | int | i | ) |

| struct hash_elem * hash_next | ( | struct hash_iterator * | i | ) |



| uint64_t hash_string | ( | const char * | s_ | ) |




|
static |



