added debug statements, dynamic allocation is working for tasks
authorMart Lubbers <mart@martlubbers.net>
Wed, 5 Apr 2017 10:01:27 +0000 (12:01 +0200)
committerMart Lubbers <mart@martlubbers.net>
Wed, 5 Apr 2017 10:01:27 +0000 (12:01 +0200)
client/task.c

index b420c19..c5fc41d 100644 (file)
@@ -18,6 +18,7 @@ void task_init(void)
 
 void task_register(void)
 {
+       debug("free memory: %lu\n", ((uint8_t *)taskspace)-spacepointer+TASKSPACE);
        int i;
        if(spacepointer+sizeof(struct task) > taskspace+TASKSPACE){
                die("Out of memory... Not enough to allocate taskstruct");
@@ -60,6 +61,7 @@ void task_register(void)
        write_byte('t');
        write16(t->taskid);
        write_byte('\n');
+       debug("free memory: %lu\n", ((uint8_t *)taskspace)+TASKSPACE-spacepointer);
 }
 
 bool is_interrupt_task(struct task *t)