Skip to content

Add configUSE_NEWLIB_REENTRANT #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion portable/MemMang/heap_useNewlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ void *__wrap_malloc(size_t nbytes) {
void *p = __real_malloc(nbytes); // Solely for debug breakpoint...
return p;
};
void *__wrap__malloc_r(void *reent, size_t nbytes) {
void *__wrap__malloc_r(void *reent __attribute__((__unused__)), size_t nbytes) {
extern void * __real__malloc_r(size_t nbytes);
void *p = __real__malloc_r(nbytes); // Solely for debug breakpoint...
return p;
Expand Down
12 changes: 12 additions & 0 deletions src/FreeRTOSConfig_Default.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,18 @@ extern char _Min_Stack_Size; /* Defined in the linker script */
#define configUSE_APPLICATION_TASK_TAG 0
#define configUSE_COUNTING_SEMAPHORES 1
#define configGENERATE_RUN_TIME_STATS 0
/*
* If configUSE_NEWLIB_REENTRANT is set to 1 then a newlib reent structure
* will be allocated for each created task.
*
* Note Newlib support has been included by popular demand, but is not used
* by the FreeRTOS maintainers themselves. FreeRTOS is not responsible for
* resulting newlib operation. User must be familiar with newlib and must
* provide system-wide implementations of the necessary stubs.
* Be warned that (at the time of writing) the current newlib design implements
* a system-wide malloc() that must be provided with locks.
*/
#define configUSE_NEWLIB_REENTRANT 1

/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
Expand Down