From 1786861415f4494a38630584a8fbc9c939a024ce Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Sat, 7 Oct 2023 22:01:56 -0400 Subject: malloc: Enable assertions if UNIT_TEST is enabled dlmalloc has some sanity checks it performs on free() which can help detect memory corruption. However, they are only enabled if DEBUG is defined before including common.h. Define DEBUG earlier if UNIT_TEST is enabled so that assertions are enabled in sandbox. Signed-off-by: Sean Anderson Reviewed-by: Simon Glass --- common/dlmalloc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'common') diff --git a/common/dlmalloc.c b/common/dlmalloc.c index 87a09d38fb3..de3f04225f4 100644 --- a/common/dlmalloc.c +++ b/common/dlmalloc.c @@ -8,14 +8,14 @@ * as file malloc-2.6.6.c. */ -#include -#include -#include - #if CONFIG_IS_ENABLED(UNIT_TEST) #define DEBUG #endif +#include +#include +#include + #include #include #include -- cgit v1.3.1 From e65f6ba08b4c75f1703d05b9524413da3c052b5e Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Tue, 5 Sep 2023 15:48:08 +0200 Subject: event: Rename rest of EVENT_SPY to EVENT_SPY_FULL or EVENT_SPY* Fix up remaining occurances of EVENT_SPY with no suffix. Fixes: 6c4cad7438 ("event: Rename EVENT_SPY to EVENT_SPY_FULL") Signed-off-by: Marek Vasut Reviewed-by: Simon Glass --- common/Kconfig | 4 ++-- include/event.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'common') diff --git a/common/Kconfig b/common/Kconfig index 5e79b542217..93c96f23b01 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -620,7 +620,7 @@ config EVENT_DYNAMIC bool help Enable this to support adding an event spy at runtime, without adding - it to the EVENT_SPY() linker list. This increases code size slightly + it to the EVENT_SPY*() linker list. This increases code size slightly but provides more flexibility for boards and subsystems that need it. config EVENT_DEBUG @@ -648,7 +648,7 @@ config SPL_EVENT_DYNAMIC depends on SPL_EVENT && EVENT_DYNAMIC help Enable this to support adding an event spy at runtime, without adding - it to the EVENT_SPY() linker list. This increases code size slightly + it to the EVENT_SPY*() linker list. This increases code size slightly but provides more flexibility for boards and subsystems that need it. endif # EVENT diff --git a/include/event.h b/include/event.h index be4cefd6ae8..c5646b713ad 100644 --- a/include/event.h +++ b/include/event.h @@ -282,9 +282,9 @@ static inline const char *event_spy_id(struct evspy_info *spy) * { * return sandbox_early_getopt_check(); * } - * EVENT_SPY(EVT_MISC_INIT_F, sandbox_misc_init_f); + * EVENT_SPY_FULL(EVT_MISC_INIT_F, sandbox_misc_init_f); * - * where EVENT_SPY uses ll_entry_declare() + * where EVENT_SPY_FULL uses ll_entry_declare() * * In this case, LTO decides to drop the sandbox_misc_init_f() function * (which is fine) but then drops the linker-list entry too. This means -- cgit v1.3.1