diff options
Diffstat (limited to 'os/src/malloc.c')
-rw-r--r-- | os/src/malloc.c | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/os/src/malloc.c b/os/src/malloc.c deleted file mode 100644 index 3d867d0..0000000 --- a/os/src/malloc.c +++ /dev/null @@ -1,23 +0,0 @@ -#include <reent.h> -#include <malloc.h> -#include <FreeRTOS.h> -#include <semphr.h> -#include "osdebug.h" - -static xSemaphoreHandle malloc_sem = NULL; - -__attribute__((constructor)) static void malloc_init() { - malloc_sem = xSemaphoreCreateMutex(); -} - -void * malloc(size_t size) { - void * ptr; -// DBGOUT("malloc(%i)\r\n", size); - - if (malloc_sem) - xSemaphoreTake(malloc_sem, portMAX_DELAY); - ptr =_malloc_r(_impure_ptr, size); - if (malloc_sem) - xSemaphoreGive(malloc_sem); - return ptr; -} |