32 size_t const suffixes = next_power_of_four(partitions);
33 size_t const suffixes_per_part = suffixes / partitions;
35 shift_value = std::countr_zero(suffixes_per_part);
49 constexpr size_t hash_partition(uint64_t
const hash)
const
51 return (hash & mask) >> shift_value;
54 static constexpr size_t next_power_of_four(
size_t number)
56 if (number == 0ULL || number == 1ULL)
60 int const highest_set_bit_pos = std::bit_width(number);
61 int const shift_amount = (highest_set_bit_pos + (highest_set_bit_pos & 1)) - 2;
63 return 0b0100ULL << shift_amount;
Definition: partition_config.hpp:23