From 61ba39a23786a7ae9694705af1d146c00a319144 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Sat, 5 Feb 2011 04:35:27 +0100 Subject: Getting rid of newlib, starting to implement a libc. Highly experimental, highly untested. --- os/src/malloc.c | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 os/src/malloc.c (limited to 'os/src/malloc.c') 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 -#include -#include -#include -#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; -} -- cgit v1.2.3