Releases: Tessil/robin-map
Releases · Tessil/robin-map
v1.4.1
v1.4.0
- Add a CMake TSL_ROBIN_MAP_ENABLE_INSTALL option to explicitly enable/disable the install target
- Move to C++17 dropping C++11 support
- Bump cmake_minimum_required version to 3.5
- Fix load threshold on deserialization
The current version computes load using max_load_factor() without first
setting m_bucket_count (default 0) leading to threshold 0, which
triggers rehash (and size increase) on first insert.
Recompute the threshold after setting correct bucket count to avoid
this. - Use inline constexpr for PRIMES and MOD_PRIME arrays
v1.3.0
v1.2.2
v1.2.1
v1.2.0
This release fixes a rare but critical bug which only occurs when a very long collision chain (> 32 767) occurs due to a poor hash function, see first bullet point. Upgrade is recommended.
- Keep rehashing if
dist_from_ideal_bucketis >DIST_FROM_IDEAL_BUCKET_LIMITduring insertion (fix issue #52)- During insertion a check was done on
dist_from_ideal_bucketto be sure it doesn't becomes bigger thanDIST_FROM_IDEAL_BUCKET_LIMITbut this was only done during the robin swap. A check should also be done beforehand if we find an empty bucket otherwise the variable could overflow and lead to bugs. This commit adds this check. - The bug should only manifest itself if the collision chain becomes larger than 32 767 due to a very poor hash function.
- During insertion a check was done on
- Disable CMake install rule if robin_map is used as subproject (#60)
- Replace deprecated
std::aligned_storagesince C++23 byalignas(#61) - Raise
DIST_FROM_IDEAL_BUCKET_LIMITto 8192 - Clear and shrink the moved hash table in the move operator to be coherent with the move constructor
- When using C++17,
std::launderthe reinterpreted pointer fromstd::aligned_storageto adapt to the change of object model introduced in P0137R1. Fix potential but very unlikely undefined behaviour.- C++17 introduced a change in the object model with P0137R1 which now requires the reinterpreted pointer from
std::aligned_storageto be laundered. See the following discussion for some details https://stackoverflow.com/questions/47735657/does-reinterpret-casting-stdaligned-storage-to-t-without-stdlaunder-violat
- C++17 introduced a change in the object model with P0137R1 which now requires the reinterpreted pointer from
- When exceptions are disabled, only print the error message when
defined(TSL_DEBUG)instead of!defined(NDEBUG) - Check that bucket_count doesn't exceed max_bucket_count() after the constructor initialization
- max_bucket_count() method relies on m_buckets_data which needs to be properly initialized first
v1.0.1
v1.0.0
- Add support for efficient serialization (#36)
- Remove compilation warnings when -Wshadow flag is set (#41)
- Fix USE_STORED_HASH_ON_REHASH to return true when bucket_count is 0, STORE_HASH is true and is_power_of_two_policy::value is true.
This commit doesn't change the actual behaviour of the map as even when USE_STORED_HASH_ON_REHASH was returning false on empty map rehashes, no stored hashes were used as the map was empty. - Fix CMake warning by specifying a project language before including GNUInstallDirs
- Create a local tsl-robin-mapTargets.cmake (#45)
v0.6.3
- Fix issue #26, raise the maximum possible size of the hash table when using the
prime_growth_policyon a 64-bit platform. - Fix issue #31, when
min_load_factor()> 0, theclear()method will also reset thebucket_countof the hash table to 0. - Fix shrink when
min_load_factoris set and a range erase withend()aslastis called. Them_try_skrink_on_next_insertwas not correctly set. - Fix issue #33, the value function of a
const iteratorcan now be called and returns a mutable reference to the underlyingvalue_type.
v0.6.2
- Fix compilation error for move-only types with a throwing move constructor/operator (#14).
- Add support for min_load_factor (#17).
- Fix compilation error when exceptions are disabled and C++ 14 or higher is used (#18).
- Fix issue #23. The
distance_typeused to store the distance of a value in a bucket from its ideal bucket could overflow when a lot of collisions happened and theload_factor()stayed belowREHASH_ON_HIGH_NB_PROBES__MIN_LOAD_FACTOR. We now rehash no matter the load factor if the distance becomes too high. - Add
bool contains(...)methods.