mmtk::util::conversions

Function rshift_align_up

source
pub const fn rshift_align_up(num: usize, bits: usize) -> usize
Expand description

Shift num by bits to the right. Add 1 to the result if any 1 bits are shifted out to the right. This is equivalent to dividing num by 2 to the power of bits, rounding up.

This function has undefined behavior if bits is greater or equal to the number of bits in usize.