summaryrefslogtreecommitdiff
path: root/include/malloc.h
diff options
context:
space:
mode:
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 1fbaf3755c..e8c8b254c0 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