7 * Userspace RCU assertion facilities.
9 * Copyright (c) 2021 Francis Deslauriers <francis.deslauriers@efficios.com>
11 * Permission is hereby granted, free of charge, to any person obtaining a copy
12 * of this software and associated documentation files (the "Software"), to deal
13 * in the Software without restriction, including without limitation the rights
14 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 * copies of the Software, and to permit persons to whom the Software is
16 * furnished to do so, subject to the following conditions:
18 * The above copyright notice and this permission notice shall be included in
19 * all copies or substantial portions of the Software.
22 #include <urcu/config.h>
25 * Force usage of an expression to prevent unused expression compiler warning.
27 #define _urcu_use_expression(_expr) ((void) sizeof((void) (_expr), 0))
31 * Vanilla assert() replacement. When NDEBUG is defined, the expression is
32 * consumed to prevent unused variable compile warnings.
34 # define urcu_posix_assert(_cond) _urcu_use_expression(_cond)
37 # define urcu_posix_assert(_cond) assert(_cond)
40 #if defined(DEBUG_RCU) || defined(CONFIG_RCU_DEBUG)
43 * Enables debugging/expensive assertions to be used in fast paths and only
44 * enabled on demand. When disabled, the expression is consumed to prevent
45 * unused variable compile warnings.
47 # define urcu_assert_debug(_cond) urcu_posix_assert(_cond)
49 # define urcu_assert_debug(_cond) _urcu_use_expression(_cond)
52 #endif /* _URCU_ASSERT_H */
This page took 0.029272 seconds and 4 git commands to generate.