ALIGN(v, a)

ARRAY_SIZE()

#define ARRAY_SIZE(arr) (sizeof(arr)/sizeof(arr[0]))

Macro to compute the size of the static array arr .

Parameters

arr

static array

 

ALIGN()

#define ALIGN(v, a) (((v) + (a)-1) & ~((a)-1))

Macro to align a value v to a specified unit a .

Parameters

v

value to be aligned

 

a

alignment unit in bytes

 

ALIGN_DOWN()

#define ALIGN_DOWN(x, a) ALIGN((x) - ((a) - 1), (a))

Macro to align down a value v to a specified unit a .

Parameters

v

value to be aligned down

 

a

alignment unit in bytes

原文地址:https://www.cnblogs.com/sinferwu/p/15179408.html