5 // Round the given value up or down to the specified power-of-two.
8 static inline T round_up(T val, int shift)
10 return (val + (1UL << shift) - 1) & ~((1UL << shift) - 1);
14 static inline T round_down(T val, int shift)
16 return val & ~((1UL << shift) - 1);