mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-31 19:24:33 +02:00
esp_compiler: generate likely and unlikely macros only when performance optimization is selected as build option
This commit is contained in:
@@ -22,7 +22,12 @@
|
||||
* to reorder instructions producing more optimized
|
||||
* code.
|
||||
*/
|
||||
#if (CONFIG_COMPILER_OPTIMIZATION_PERF)
|
||||
#define likely(x) __builtin_expect(!!(x), 1)
|
||||
#define unlikely(x) __builtin_expect(!!(x), 0)
|
||||
#else
|
||||
#define likely(x) (x)
|
||||
#define unlikely(x) (x)
|
||||
#endif
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user