mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-25 17:58:46 +00:00
Merge branch 'feature/likely_unlikely' into 'master'
Adding likely unlikely macros to hot code paths Closes IDF-284 See merge request espressif/esp-idf!6368
This commit is contained in:
@@ -94,6 +94,8 @@
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/* for likely and unlikely */
|
||||
#include "esp_compiler.h"
|
||||
|
||||
/* Application specific configuration options. */
|
||||
#include "FreeRTOSConfig.h"
|
||||
|
@@ -126,12 +126,12 @@ int xt_clock_freq(void) __attribute__((deprecated));
|
||||
#if defined(CONFIG_FREERTOS_ASSERT_DISABLE)
|
||||
#define configASSERT(a) /* assertions disabled */
|
||||
#elif defined(CONFIG_FREERTOS_ASSERT_FAIL_PRINT_CONTINUE)
|
||||
#define configASSERT(a) if (!(a)) { \
|
||||
#define configASSERT(a) if (unlikely(!(a))) { \
|
||||
ets_printf("%s:%d (%s)- assert failed!\n", __FILE__, __LINE__, \
|
||||
__FUNCTION__); \
|
||||
}
|
||||
#else /* CONFIG_FREERTOS_ASSERT_FAIL_ABORT */
|
||||
#define configASSERT(a) if (!(a)) { \
|
||||
#define configASSERT(a) if (unlikely(!(a))) { \
|
||||
ets_printf("%s:%d (%s)- assert failed!\n", __FILE__, __LINE__, \
|
||||
__FUNCTION__); \
|
||||
abort(); \
|
||||
|
Reference in New Issue
Block a user