Skip to content

v1.2.0

Compare
Choose a tag to compare
@Tessil Tessil released this 05 Jan 22:57
· 12 commits to master since this release

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_bucket is > DIST_FROM_IDEAL_BUCKET_LIMIT during insertion (fix issue #52)
    • During insertion a check was done on dist_from_ideal_bucket to be sure it doesn't becomes bigger than DIST_FROM_IDEAL_BUCKET_LIMIT but 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.
  • Disable CMake install rule if robin_map is used as subproject (#60)
  • Replace deprecated std::aligned_storage since C++23 by alignas (#61)
  • Raise DIST_FROM_IDEAL_BUCKET_LIMIT to 8192
  • Clear and shrink the moved hash table in the move operator to be coherent with the move constructor
  • When using C++17, std::launder the reinterpreted pointer from std::aligned_storage to adapt to the change of object model introduced in P0137R1. Fix potential but very unlikely undefined behaviour.
  • 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