1
|
1 void initContext(struct Context* context) {
|
|
2 context->heapLimit = sizeof(union Data)*ALLOCATE_SIZE;
|
|
3 context->code = (__code(**) (struct Context*)) NEWN(ALLOCATE_SIZE, void*);
|
|
4 context->data = NEWN(ALLOCATE_SIZE, union Data*);
|
|
5 context->heapStart = NEWN(context->heapLimit, char);
|
|
6 context->heap = context->heapStart;
|
|
7
|
|
8 context->code[C_cs1] = cs1_stub;
|
|
9 context->code[C_cs2] = cs2_stub;
|
|
10 context->code[C_exit_code] = exit_code_stub;
|
|
11 context->code[C_start_code] = start_code_stub;
|
|
12
|
|
13 ALLOC_DATA(context, Context);
|
|
14 ...
|
|
15 }
|