The
roundup() and
rounddown() macros return an integer from rounding
x up and down, respectively, to the next
size. The
howmany() macro in turn reveals how many times
size fits into
x, rounding the residual up.
The
roundup2() macro also rounds up, but with the assumption that
x is a power of two. If
x is indeed a power of two,
powerof2() return 1.