> OT: these are a little unclear to me. Could someone outline what > > roundup > roundup2 > rounddown > howmany
They are in <sys/param.h>. >> #define howmany(x, y) (((x)+((y)-1))/(y)) how many y-byte blocks are required to store x-bytes region? >> #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) >> #define rounddown(x,y) (((x)/(y))*(y)) roundup or rounddown x per y, as is? >> #define roundup2(x, m) (((x) + (m) - 1) & ~((m) - 1)) optimized version (avoid division op) roundup() where m is a power of two --- Izumi Tsutsui