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

相关文章:

  • 2021-05-21
  • 2022-02-27
  • 2022-02-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-06
  • 2021-05-30
猜你喜欢
  • 2021-09-28
  • 2022-01-04
  • 2022-01-02
  • 2021-07-26
  • 2022-12-23
  • 2022-12-23
  • 2022-03-06
相关资源
相似解决方案