comparison runtime/context.h @ 56:d2f9b0a9403d

Initial experiment with goto and switch
author Mike Pavone <pavone@retrodev.com>
date Thu, 08 Oct 2009 01:52:38 -0400
parents 8d74ef7fa357
children 04baa003de5a
comparison
equal deleted inserted replaced
38:7f05bbe82f24 56:d2f9b0a9403d
12 struct stackchunk * prev; 12 struct stackchunk * prev;
13 uint32_t used; 13 uint32_t used;
14 char data[STACK_CHUNK_SIZE]; 14 char data[STACK_CHUNK_SIZE];
15 } stackchunk; 15 } stackchunk;
16 16
17 typedef struct {
18 rhope_func func;
19 struct calldata *params;
20 } unwind_cell;
21
22 typedef struct context { 17 typedef struct context {
23 stackchunk *stack_begin; 18 stackchunk *stack_begin;
24 stackchunk *current_stack; 19 stackchunk *current_stack;
25 unwind_cell *unwind;
26 } context; 20 } context;
27 21
28 stackchunk * new_stack(); 22 stackchunk * new_stack();
29 context * new_context(); 23 context * new_context();
30 void * alloc_stack(context * ct, uint32_t size); 24 void * alloc_stack(context * ct, uint32_t size);
31 struct calldata * alloc_cdata(context * ct, uint32_t num_params); 25 struct calldata * alloc_cdata(context * ct, struct calldata * lastframe, uint32_t num_params);
32 void free_stack(context * ct, void * data); 26 void free_stack(context * ct, void * data);
33 #endif //_CONTEXT_H_ 27 #endif //_CONTEXT_H_