summaryrefslogtreecommitdiff
path: root/os/src/malloc.c
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2011-02-05 04:35:27 +0100
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2011-02-05 04:35:27 +0100
commit61ba39a23786a7ae9694705af1d146c00a319144 (patch)
treef9ad51bee751f7e878ac3e7ad4d45f993605c37d /os/src/malloc.c
parente2d292afdb43cd7d9391128563384e1edd53c52e (diff)
Getting rid of newlib, starting to implement a libc. Highly experimental, highly untested.
Diffstat (limited to 'os/src/malloc.c')
-rw-r--r--os/src/malloc.c23
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;
-}