Originally Posted by Mrs Beanbag
Just patch "free" and "allocmem" &c to keep reserved memory blocks in a doubly linked list for each task.
At the far back of my head I remember something about an article where someone wrote up a way of how you could attach allocations to the task structure.
Anything you allocate and leave behind after you exit will crash&burn. Think Setfunction().