comparison src/parallel_execution/context.c @ 123:4ff6f093b695

Fix segmentation fault
author Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
date Tue, 13 Sep 2016 11:54:25 +0900
parents a086857e1812
children acf0453b1c7a
comparison
equal deleted inserted replaced
122:a086857e1812 123:4ff6f093b695
49 extern __code createData2_stub(struct Context*); 49 extern __code createData2_stub(struct Context*);
50 extern __code createTask1_stub(struct Context*); 50 extern __code createTask1_stub(struct Context*);
51 extern __code createTask2_stub(struct Context*); 51 extern __code createTask2_stub(struct Context*);
52 extern __code createTask3_stub(struct Context*); 52 extern __code createTask3_stub(struct Context*);
53 extern __code createTask4_stub(struct Context*); 53 extern __code createTask4_stub(struct Context*);
54 extern __code createTask5_stub(struct Context*);
54 extern __code poll1_stub(struct Context*); 55 extern __code poll1_stub(struct Context*);
55 extern __code poll2_stub(struct Context*); 56 extern __code poll2_stub(struct Context*);
56 /* extern __code createTask3_stub(struct Context*); */ 57 /* extern __code createTask3_stub(struct Context*); */
57 /* extern __code createTask4_stub(struct Context*); */ 58 /* extern __code createTask4_stub(struct Context*); */
58 extern __code putQueue1_stub(struct Context*); 59 extern __code putQueue1_stub(struct Context*);
78 79
79 __code initContext(struct Context* context) { 80 __code initContext(struct Context* context) {
80 context->heapLimit = sizeof(union Data)*ALLOCATE_SIZE; 81 context->heapLimit = sizeof(union Data)*ALLOCATE_SIZE;
81 context->code = (__code(**) (struct Context*)) NEWN(ALLOCATE_SIZE, void*); 82 context->code = (__code(**) (struct Context*)) NEWN(ALLOCATE_SIZE, void*);
82 context->data = NEWN(ALLOCATE_SIZE, union Data*); 83 context->data = NEWN(ALLOCATE_SIZE, union Data*);
84 context->mData = NEWN(ALLOCATE_SIZE, union Data*);
83 context->heapStart = NEWN(context->heapLimit, char); 85 context->heapStart = NEWN(context->heapLimit, char);
84 context->heap = context->heapStart; 86 context->heap = context->heapStart;
85 87
86 context->codeNum = Exit; 88 context->codeNum = Exit;
87 89
128 context->code[CreateData2] = createData2_stub; 130 context->code[CreateData2] = createData2_stub;
129 context->code[CreateTask1] = createTask1_stub; 131 context->code[CreateTask1] = createTask1_stub;
130 context->code[CreateTask2] = createTask2_stub; 132 context->code[CreateTask2] = createTask2_stub;
131 context->code[CreateTask3] = createTask3_stub; 133 context->code[CreateTask3] = createTask3_stub;
132 context->code[CreateTask4] = createTask4_stub; 134 context->code[CreateTask4] = createTask4_stub;
135 context->code[CreateTask5] = createTask5_stub;
136 context->code[Poll1] = poll1_stub;
137 context->code[Poll2] = poll2_stub;
133 context->code[PutQueue1] = putQueue1_stub; 138 context->code[PutQueue1] = putQueue1_stub;
134 context->code[PutQueue2] = putQueue2_stub; 139 context->code[PutQueue2] = putQueue2_stub;
135 context->code[PutQueue3] = putQueue3_stub; 140 context->code[PutQueue3] = putQueue3_stub;
136 context->code[PutQueue4] = putQueue4_stub; 141 context->code[PutQueue4] = putQueue4_stub;
137 context->code[InitWorker] = initWorker_stub; 142 context->code[InitWorker] = initWorker_stub;