58#define NULL_KEY 18446744073709551615
85 return (key*2654435761 % map->
capacity);
94 while (map->
arr[cur_index] != key && map->
arr[cur_index] !=
NULL_KEY)
96 cur_index = (cur_index + 2) % (map->
capacity*2);
98 if (
debug && count % 100 == 0)
99 fprintf(stderr,
"Warning: fast_map set_value(): Big Count %d -- %lu - %lu, %lu, %lu\n",
100 procid, count, cur_index, key, value);
104 map->
arr[cur_index] = key;
106 map->
arr[cur_index+1] = value;
113 while (map->
arr[cur_index] != key && map->
arr[cur_index] !=
NULL_KEY)
115 cur_index = (cur_index + 2) % (map->
capacity*2);
117 if (
debug && count % 100 == 0)
118 fprintf(stderr,
"Warning: fast_map set_value_uq(): Big Count %d -- %lu - %lu, %lu, %lu\n",
119 procid, count, cur_index, key, value);
123 map->
arr[cur_index] = key;
128 map->
arr[cur_index+1] = value;
135 while (map->
arr[cur_index] != key && map->
arr[cur_index] !=
NULL_KEY)
136 cur_index = (cur_index + 2) % (map->
capacity*2);
140 return map->
arr[cur_index+1];
147 std::vector<uint64_t> vec;
161 max_key = vec[(int)rand() % vec.size()];
uint64_t get_max_key(fast_map *map)
void set_value(fast_map *map, uint64_t key, uint64_t value)
void clear_map(fast_map *map)
uint64_t get_value(fast_map *map, uint64_t key)
void init_map_nohash(fast_map *map, uint64_t init_size)
void set_value_uq(fast_map *map, uint64_t key, uint64_t value)
void empty_map(fast_map *map)
uint64_t mult_hash(fast_map *map, uint64_t key)
bool is_init(fast_map *map)
void init_map(fast_map *map)
unsigned __int64 uint64_t
uint64_t * unique_indexes