`(new_capacity - 1) & new_capacity == 0` is the cheapest way to check for "is this a power of two".