summaryrefslogtreecommitdiffstats
path: root/common/memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/memory.c')
-rw-r--r--common/memory.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/common/memory.c b/common/memory.c
index f0ae1ccbaf..faff33b419 100644
--- a/common/memory.c
+++ b/common/memory.c
@@ -47,11 +47,19 @@ unsigned long mem_malloc_end(void)
return malloc_end;
}
+#ifdef CONFIG_MALLOC_TLSF
+#include <tlsf.h>
+tlsf_pool tlsf_mem_pool;
+#endif
+
void mem_malloc_init(void *start, void *end)
{
malloc_start = (unsigned long)start;
malloc_end = (unsigned long)end;
malloc_brk = malloc_start;
+#ifdef CONFIG_MALLOC_TLSF
+ tlsf_mem_pool = tlsf_create(start, (char *)end - (char *)start);
+#endif
}
#ifndef __SANDBOX__