summaryrefslogtreecommitdiff
path: root/include/malloc.h
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2022-04-11 10:15:06 -0400
committerTom Rini <[email protected]>2022-04-11 10:15:06 -0400
commitc45d38d6515811c05469fe4df6d351d7e4f990f0 (patch)
treef965f66f82242027746ba8bba0abb442aeed09be /include/malloc.h
parentb598957206e541b3f8876ae34a15fac6da90dcef (diff)
parent02fc867810866904966d45c3e290810c4a196543 (diff)
Merge branch '2022-04-11-initial-valgrind-support'
To quote the author: This series adds support for running valgrind against U-Boot's internal malloc. This allows for much more useful reports to be generated. Some example output of valgrind run against u-boot/master with this branch applied may be found at [1]. Note that valgrind gives up around acpi. This feature still needs a lot of work on suppressions/hints to filter out the noise properly. [1] https://gist.githubusercontent.com/Forty-Bot/199bf06f9cdd6871e54f8f484c16e111/raw/2a2f99108eef84b48e27a54332f3f71f4e2e5342/gistfile1.txt
Diffstat (limited to 'include/malloc.h')
-rw-r--r--include/malloc.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/malloc.h b/include/malloc.h
index 1fbaf3755c7..e8c8b254c0d 100644
--- a/include/malloc.h
+++ b/include/malloc.h
@@ -887,7 +887,11 @@ void malloc_simple_info(void);
#define malloc malloc_simple
#define realloc realloc_simple
#define memalign memalign_simple
+#if IS_ENABLED(CONFIG_VALGRIND)
+#define free free_simple
+#else
static inline void free(void *ptr) {}
+#endif
void *calloc(size_t nmemb, size_t size);
void *realloc_simple(void *ptr, size_t size);
#else