summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-04-12 11:45:36 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2017-04-28 08:04:59 +0200
commit1ce56a21a040ffdc9415d1d42174e916341d2be3 (patch)
treecd00f3beaa18d51613800fe79562812253795700 /common
parentbd3b279d0d5bc3aa8593066d302ca025aed81de0 (diff)
downloadbarebox-1ce56a21a040ffdc9415d1d42174e916341d2be3.tar.gz
barebox-1ce56a21a040ffdc9415d1d42174e916341d2be3.tar.xz
xfuncs: Be more informative when out of memory panic occurs
When one of the xfuncs panics we can be a bit more informative. We can at least print the amount of bytes we wanted to allocate and how much memory we have left. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common')
-rw-r--r--common/dlmalloc.c3
-rw-r--r--common/dummy_malloc.c4
2 files changed, 4 insertions, 3 deletions
diff --git a/common/dlmalloc.c b/common/dlmalloc.c
index 499ec93c28..9c33cc2c95 100644
--- a/common/dlmalloc.c
+++ b/common/dlmalloc.c
@@ -1753,7 +1753,6 @@ void *calloc(size_t n, size_t elem_size)
/* Utility to update current_mallinfo for malloc_stats and mallinfo() */
-#ifdef CONFIG_CMD_MEMINFO
static void malloc_update_mallinfo(void)
{
int i;
@@ -1821,8 +1820,6 @@ void malloc_stats(void)
#endif
}
-#endif /* CONFIG_CMD_MEMINFO */
-
/*
History:
diff --git a/common/dummy_malloc.c b/common/dummy_malloc.c
index dd36a5b156..641baa125a 100644
--- a/common/dummy_malloc.c
+++ b/common/dummy_malloc.c
@@ -24,6 +24,10 @@
#include <common.h>
#include <malloc.h>
+void malloc_stats(void)
+{
+}
+
void *memalign(size_t alignment, size_t bytes)
{
unsigned long mem = (unsigned long)sbrk(bytes + alignment);