summaryrefslogtreecommitdiff
path: root/components/libc/compilers/newlib/minilib.c
diff options
context:
space:
mode:
Diffstat (limited to 'components/libc/compilers/newlib/minilib.c')
-rw-r--r--components/libc/compilers/newlib/minilib.c66
1 files changed, 0 insertions, 66 deletions
diff --git a/components/libc/compilers/newlib/minilib.c b/components/libc/compilers/newlib/minilib.c
deleted file mode 100644
index 612554ca66..0000000000
--- a/components/libc/compilers/newlib/minilib.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2006-2021, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date Author Notes
- * 2021-02-23 Meco Man first version
- */
-
-#include <reent.h>
-#include <rtthread.h>
-
-#ifdef RT_USING_HEAP /* Memory routine */
-#include <sys/errno.h>
-
-void * _malloc_r (struct _reent *ptr, size_t size)
-{
- void* result;
-
- result = (void*)rt_malloc (size);
- if (result == RT_NULL)
- {
- ptr->_errno = ENOMEM;
- }
-
- return result;
-}
-
-void * _realloc_r (struct _reent *ptr, void *old, size_t newlen)
-{
- void* result;
-
- result = (void*)rt_realloc (old, newlen);
- if (result == RT_NULL)
- {
- ptr->_errno = ENOMEM;
- }
-
- return result;
-}
-
-void *_calloc_r (struct _reent *ptr, size_t size, size_t len)
-{
- void* result;
-
- result = (void*)rt_calloc (size, len);
- if (result == RT_NULL)
- {
- ptr->_errno = ENOMEM;
- }
-
- return result;
-}
-
-void _free_r (struct _reent *ptr, void *addr)
-{
- rt_free (addr);
-}
-
-#else
-void * _sbrk_r(struct _reent *ptr, ptrdiff_t incr)
-{
- return RT_NULL;
-}
-#endif /*RT_USING_HEAP*/