Tags: tidwall/hashmap.c
Tags
Add load factor option It's now possible to set the load factor at compile time using the HASHMAP_LOAD_FACTOR define: cc -DHASHMAP_LOAD_FACTOR=0.75 ... or by using the hashmap_set_load_factor function hashmap_set_load_factor(map, 0.75); The load factor should be in the range of 50% to 95%.
Various new updates, features, and optimizations Changes: - Added xxhash3 hasher function. - Added _with_hash functions for manually providing a hash to the get, set, and delete functions. This makes the hash callback that is given to the hashmap_new function optional. - Added set_grow_by_power which defines how quickly the hashmap grows when needed. Default is 1, which mean it doubles each time it needs to grow, setting to 2 or 3 will grow by 4 or 8 respectively. Max 16. - Default grow_at percentange has been changed from 0.75 to 0.60. - The hash field now clipped with bitwise AND instead of shifting. - The compare function is now optional. When not provided, the clipped (48-bit) hash becomes the key. - Code cleanup
PreviousNext