From e03045122053ab8bc1422e03ae723db9ac7ffa98 Mon Sep 17 00:00:00 2001 From: Grissiom Date: Tue, 14 Oct 2014 16:14:02 +0800 Subject: [PATCH] minilibc: only define malloc family when RT_USING_HEAP enabled --- components/libc/minilibc/stdlib.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/libc/minilibc/stdlib.c b/components/libc/minilibc/stdlib.c index 51cb07fee..e29ae9bc2 100644 --- a/components/libc/minilibc/stdlib.c +++ b/components/libc/minilibc/stdlib.c @@ -54,6 +54,7 @@ long int atol(const char* s) return sign?-v:v; } +#ifdef RT_USING_HEAP void *malloc(size_t size) { return rt_malloc(size); @@ -73,5 +74,6 @@ void *calloc(size_t nelem, size_t elsize) { return rt_calloc(nelem, elsize); } +#endif #endif -- GitLab