Beispiel #1
0
void core_dynamic_hash_table_init(struct core_dynamic_hash_table *self, uint64_t buckets,
                int key_size, int value_size)
{
#ifdef CORE_DYNAMIC_HASH_TABLE_DEBUG
    printf("DEBUG core_dynamic_hash_table_init buckets %d key_size %d value_size %d\n",
                    (int)buckets, key_size, value_size);
#endif

    core_dynamic_hash_table_reset(self);

#ifdef CORE_DYNAMIC_HASH_TABLE_DEBUG
    printf("value size %d\n", value_size);
#endif

    core_hash_table_init(self->current, buckets, key_size, value_size);
    buckets = core_hash_table_buckets(self->current);
    self->resize_next_size = 2 * buckets;
    self->resize_in_progress = 0;

    core_dynamic_hash_table_set_threshold(self, CORE_DYNAMIC_HASH_TABLE_THRESHOLD);
}
Beispiel #2
0
void core_map_set_threshold(struct core_map *map, double threshold)
{
    core_dynamic_hash_table_set_threshold(&map->table, threshold);
}