Skip to content
Snippets Groups Projects
Forked from Core Modules / dune-common
Source project has a limited visibility.
  • Steffen Müthing's avatar
    42dacc67
    [Hash][Bugfix] Add a working hash combining algorithm for 32-bit platforms · 42dacc67
    Steffen Müthing authored
    As Carsten pointed out, the hash combining algorithms doesn't work
    correctly for 32-bit platforms because it uses a multiplication with
    a 64-bit constant.
    
    This patch adds a switch for picking different algorithms based on the
    size of std::size_t using a new struct hash_combiner that is templated
    on the size of std::size_t.
    
    Right now, there are implementations for 64-bit and 32-bit platforms,
    both based on CityHash.
    42dacc67
    History
    [Hash][Bugfix] Add a working hash combining algorithm for 32-bit platforms
    Steffen Müthing authored
    As Carsten pointed out, the hash combining algorithms doesn't work
    correctly for 32-bit platforms because it uses a multiplication with
    a 64-bit constant.
    
    This patch adds a switch for picking different algorithms based on the
    size of std::size_t using a new struct hash_combiner that is templated
    on the size of std::size_t.
    
    Right now, there are implementations for 64-bit and 32-bit platforms,
    both based on CityHash.