소스 검색

minilibc: only define malloc family when RT_USING_HEAP enabled

Grissiom 10 년 전
부모
커밋
e030451220
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      components/libc/minilibc/stdlib.c

+ 2 - 0
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