| 1 |
#ifndef AWS_COMMON_PRIVATE_HASH_TABLE_IMPL_H |
| 2 |
#define AWS_COMMON_PRIVATE_HASH_TABLE_IMPL_H |
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
#include <aws/common/common.h> |
| 10 |
#include <aws/common/hash_table.h> |
| 11 |
#include <aws/common/math.h> |
| 12 |
|
| 13 |
struct hash_table_entry { |
| 14 |
struct aws_hash_element element; |
| 15 |
uint64_t hash_code; |
| 16 |
}; |
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
#ifdef _MSC_VER |
| 25 |
# pragma warning(push) |
| 26 |
# pragma warning(disable : 4200) |
| 27 |
#endif |
| 28 |
struct hash_table_state { |
| 29 |
aws_hash_fn *hash_fn; |
| 30 |
aws_hash_callback_eq_fn *equals_fn; |
| 31 |
aws_hash_callback_destroy_fn *destroy_key_fn; |
| 32 |
aws_hash_callback_destroy_fn *destroy_value_fn; |
| 33 |
struct aws_allocator *alloc; |
| 34 |
|
| 35 |
size_t size, entry_count; |
| 36 |
size_t max_load; |
| 37 |
|
| 38 |
size_t mask; |
| 39 |
double max_load_factor; |
| 40 |
|
| 41 |
struct hash_table_entry slots[]; |
| 42 |
}; |
| 43 |
#ifdef _MSC_VER |
| 44 |
# pragma warning(pop) |
| 45 |
#endif |
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
bool hash_table_state_is_valid(const struct hash_table_state *map); |
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
int hash_table_state_required_bytes(size_t size, size_t *required_bytes); |
| 61 |
|
| 62 |
#endif |