This can use uint::next_power_of_two.