mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
added address alignment macros for 'struct pool'
This commit is contained in:
parent
002c6f8d5f
commit
156e30a60d
1 changed files with 6 additions and 0 deletions
|
@ -43,6 +43,12 @@
|
|||
#define XSTR(x) STR(x)
|
||||
#define STR(x) #x
|
||||
|
||||
#define ALIGN(x, a) ALIGN_MASK(x, (uintptr_t) (a) - 1)
|
||||
#define ALIGN_MASK(x, m) (((uintptr_t) (x) + (m)) & ~(m))
|
||||
#define IS_ALIGNED(x, a) (ALIGN(x, a) == (uintptr_t) x)
|
||||
|
||||
#define CEIL(x, y) ((x + y - 1) / y)
|
||||
|
||||
/** Calculate the number of elements in an array. */
|
||||
#define ARRAY_LEN(a) ( sizeof (a) / sizeof (a)[0] )
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue