From: Sean Anderson Date: Sun, 8 Oct 2023 02:01:56 +0000 (-0400) Subject: malloc: Enable assertions if UNIT_TEST is enabled X-Git-Url: http://git.dujemihanovic.xyz/img/static/git-favicon.png?a=commitdiff_plain;h=1786861415f4494a38630584a8fbc9c939a024ce;p=u-boot.git 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 --- diff --git a/common/dlmalloc.c b/common/dlmalloc.c index 87a09d38fb..de3f04225f 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