Skip to content

Commit 58eccf4

Browse files
committed
Use newlib libc library
This change adds libcmin.a, which is created from newlib libc by selectively removing some of the object files (mostly related to heap management). The list of files is available in tools/sdk/lib/make_libcmin.sh. Files which are not needed are commented out. This change adds support for various functions which were missing, like sscanf, strftime, etc.
1 parent 5cec334 commit 58eccf4

File tree

7 files changed

+614
-530
lines changed

7 files changed

+614
-530
lines changed

cores/esp8266/heap.c

+21
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,27 @@
66
#include <stdlib.h>
77
#include "umm_malloc/umm_malloc.h"
88
#include <c_types.h>
9+
#include <sys/reent.h>
10+
11+
void* _malloc_r(struct _reent* unused, size_t size)
12+
{
13+
return malloc(size);
14+
}
15+
16+
void _free_r(struct _reent* unused, void* ptr)
17+
{
18+
return free(ptr);
19+
}
20+
21+
void* _realloc_r(struct _reent* unused, void* ptr, size_t size)
22+
{
23+
return realloc(ptr, size);
24+
}
25+
26+
void* _calloc_r(struct _reent* unused, size_t count, size_t size)
27+
{
28+
return calloc(count, size);
29+
}
930

1031
void* ICACHE_RAM_ATTR pvPortMalloc(size_t size, const char* file, int line)
1132
{

0 commit comments

Comments
 (0)