Mercurial > repos > rhope
diff runtime/context.c @ 63:04baa003de5a
Merged latest changes with better C branch
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Wed, 05 May 2010 22:12:23 -0400 |
parents | d2f9b0a9403d 079200bc3e75 |
children | d4b44ae2e34a |
line wrap: on
line diff
--- a/runtime/context.c Sat Oct 10 16:43:37 2009 -0400 +++ b/runtime/context.c Wed May 05 22:12:23 2010 -0400 @@ -19,6 +19,18 @@ c->stack_begin = new_stack(); c->current_stack = c->stack_begin; return c; +} + +void free_context(context * c) +{ + stackchunk *next,*current = c->stack_begin; + while(current) + { + next = current->next; + free(current); + current = next; + } + free(c); } void * alloc_stack(context * ct, uint32_t size)