mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-02 12:14:32 +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
|
* to reorder instructions producing more optimized
|
||||||
* code.
|
* code.
|
||||||
*/
|
*/
|
||||||
|
#if (CONFIG_COMPILER_OPTIMIZATION_PERF)
|
||||||
#define likely(x) __builtin_expect(!!(x), 1)
|
#define likely(x) __builtin_expect(!!(x), 1)
|
||||||
#define unlikely(x) __builtin_expect(!!(x), 0)
|
#define unlikely(x) __builtin_expect(!!(x), 0)
|
||||||
|
#else
|
||||||
|
#define likely(x) (x)
|
||||||
|
#define unlikely(x) (x)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
Reference in New Issue
Block a user