Skip to content

Commit

Permalink
[libc] picolibc support heap. (#7571)
Browse files Browse the repository at this point in the history
  • Loading branch information
Guozhanxin authored May 26, 2023
1 parent 8768d63 commit 7a4f9d0
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions components/libc/compilers/picolibc/syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,29 @@ int pico_get_errno(void)
{
return rt_get_errno();
}

#ifdef RT_USING_HEAP /* Memory routine */
void *malloc(size_t n)
{
return rt_malloc(n);
}
RTM_EXPORT(malloc);

void *realloc(void *rmem, size_t newsize)
{
return rt_realloc(rmem, newsize);
}
RTM_EXPORT(realloc);

void *calloc(size_t nelem, size_t elsize)
{
return rt_calloc(nelem, elsize);
}
RTM_EXPORT(calloc);

void free(void *rmem)
{
rt_free(rmem);
}
RTM_EXPORT(free);
#endif

0 comments on commit 7a4f9d0

Please sign in to comment.