Realm
A distributed, event-based tasking library
Loading...
Searching...
No Matches
ucp_utils.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CHKERR_ACTION(_cond, _msg, _log, _action)
#define CHKERR_JUMP(_cond, _msg, _log, _label)
#define IS_POW2_OR_ZERO(_n)
#define IS_POW2(_n)
#define PADDING_TO_ALIGN(_n, _alignment)
#define ALIGN_DOWN_POW2(_n, _alignment)
#define ALIGN_UP_POW2(_n, _alignment)

Macro Definition Documentation

◆ ALIGN_DOWN_POW2

#define ALIGN_DOWN_POW2 ( _n,
_alignment )
Value:
((_n) & ~((_alignment)-1))

◆ ALIGN_UP_POW2

#define ALIGN_UP_POW2 ( _n,
_alignment )
Value:
ALIGN_DOWN_POW2((_n) + (_alignment)-1, _alignment)
#define ALIGN_DOWN_POW2(_n, _alignment)
Definition ucp_utils.h:39

◆ CHKERR_ACTION

#define CHKERR_ACTION ( _cond,
_msg,
_log,
_action )
Value:
do { \
if(_cond) { \
_log.error() << _msg; \
_action; \
} \
} while(0)

◆ CHKERR_JUMP

#define CHKERR_JUMP ( _cond,
_msg,
_log,
_label )
Value:
CHKERR_ACTION(_cond, _msg, _log, goto _label)
#define CHKERR_ACTION(_cond, _msg, _log, _action)
Definition ucp_utils.h:21

◆ IS_POW2

#define IS_POW2 ( _n)
Value:
(((_n) > 0) && IS_POW2_OR_ZERO(_n))
#define IS_POW2_OR_ZERO(_n)
Definition ucp_utils.h:32

◆ IS_POW2_OR_ZERO

#define IS_POW2_OR_ZERO ( _n)
Value:
!((_n) & ((_n)-1))

◆ PADDING_TO_ALIGN

#define PADDING_TO_ALIGN ( _n,
_alignment )
Value:
(((_alignment) - (_n) % (_alignment)) % (_alignment))