heap: Wrap the function hook feature under a configuration

also update heap_debug.rst and mem_alloc.rst to provide information about the feature
This commit is contained in:
Guillaume Souchere
2023-03-08 10:48:17 +01:00
committed by Mahavir Jain
parent 5a1f0cd63c
commit 2f982107dc
8 changed files with 42 additions and 0 deletions

View File

@@ -15,11 +15,15 @@
#include "heap_private.h"
#include "esp_system.h"
#ifdef CONFIG_HEAP_USE_HOOKS
#define CALL_HOOK(hook, ...) { \
if (hook != NULL) { \
hook(__VA_ARGS__); \
} \
}
#else
#define CALL_HOOK(hook, ...) {}
#endif
/* Forward declaration for base function, put in IRAM.
* These functions don't check for errors after trying to allocate memory. */