Mercurial > repos > rhope
comparison 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 |
comparison
equal
deleted
inserted
replaced
62:b218af069da7 | 63:04baa003de5a |
---|---|
17 { | 17 { |
18 context * c = malloc(sizeof(context)); | 18 context * c = malloc(sizeof(context)); |
19 c->stack_begin = new_stack(); | 19 c->stack_begin = new_stack(); |
20 c->current_stack = c->stack_begin; | 20 c->current_stack = c->stack_begin; |
21 return c; | 21 return c; |
22 } | |
23 | |
24 void free_context(context * c) | |
25 { | |
26 stackchunk *next,*current = c->stack_begin; | |
27 while(current) | |
28 { | |
29 next = current->next; | |
30 free(current); | |
31 current = next; | |
32 } | |
33 free(c); | |
22 } | 34 } |
23 | 35 |
24 void * alloc_stack(context * ct, uint32_t size) | 36 void * alloc_stack(context * ct, uint32_t size) |
25 { | 37 { |
26 void * ret; | 38 void * ret; |