mirror of
https://github.com/Fishwaldo/bl_mcu_sdk.git
synced 2025-07-07 05:18:34 +00:00
[feat][bsp_common/platform] complete calloc function that float print needs
This commit is contained in:
parent
626c6f3fae
commit
31564a9bdd
1 changed files with 13 additions and 4 deletions
|
@ -232,14 +232,19 @@ void *_realloc_r(struct _reent *ptr, void *old, size_t newlen)
|
||||||
if (result == NULL) {
|
if (result == NULL) {
|
||||||
ptr->_errno = -ENOMEM;
|
ptr->_errno = -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *_calloc_r(struct _reent *ptr, size_t size, size_t len)
|
void *_calloc_r(struct _reent *ptr, size_t size, size_t len)
|
||||||
{
|
{
|
||||||
/* return "not supported" */
|
void *result;
|
||||||
return 0;
|
|
||||||
|
result = (void *)mmheap_calloc(&mmheap_root, size, len);
|
||||||
|
if (result == NULL) {
|
||||||
|
ptr->_errno = -ENOMEM;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _free_r(struct _reent *ptr, void *addr)
|
void _free_r(struct _reent *ptr, void *addr)
|
||||||
|
@ -249,7 +254,11 @@ void _free_r(struct _reent *ptr, void *addr)
|
||||||
|
|
||||||
void *_sbrk_r(struct _reent *ptr, ptrdiff_t incr)
|
void *_sbrk_r(struct _reent *ptr, ptrdiff_t incr)
|
||||||
{
|
{
|
||||||
return 0;
|
void *ret;
|
||||||
|
ptr->_errno = ENOMEM;
|
||||||
|
ret = (void *)-1;
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* for exit() and abort() */
|
/* for exit() and abort() */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue