shares are dynamically allocated as well:)
[mTask.git] / client / mem.c
index 38bd6bd..f4cdf2c 100644 (file)
@@ -1,3 +1,16 @@
 #include <stdlib.h>
+#include <stdint.h>
 
-struct task *task_head = NULL;
+#include "mem.h"
+
+uint8_t mem[MEMSIZE] = {0};
+
+uint8_t *mem_top = &mem[MEMSIZE-1];
+uint8_t *mem_bottom = &mem[0];
+uint8_t *mem_task = &mem[0];
+uint8_t *mem_sds = &mem[MEMSIZE-1];
+
+uint16_t mem_free(void)
+{
+       return mem_sds-mem_task;
+}