I am studying XINU OS, and came across this simple one-line function. Is it possible to explain how this function is working and rounding x to nearest block size for memory allocation? Please don't mind if the query is too simple.
I am also confused why will the change it to a char pointer.
/*----------------------------------------------------------------------
*roundmb, truncmb - round or truncate address to memory block size
*----------------------------------------------------------------------
*/
#define roundmb(x) (char *)( (7 + (uint32)(x)) & (~7) )
Link to the complete XINU code: https://github.com/xinu-os/xinu/blob/master/include/memory.h