Mercurial > hg > GearsTemplate
annotate src/parallel_execution/context.c @ 186:dbc064c26b98
generate context script
author | mir3636 |
---|---|
date | Thu, 15 Dec 2016 19:38:18 +0900 |
parents | 247a2c4a8908 |
children | bacc37265386 |
rev | line source |
---|---|
86 | 1 #include <stdlib.h> |
2 | |
3 #include "context.h" | |
132 | 4 #include "stack.h" |
167 | 5 #include "queue.h" |
86 | 6 |
186 | 7 #include "c/extern.h" |
86 | 8 |
9 __code initContext(struct Context* context) { | |
10 context->heapLimit = sizeof(union Data)*ALLOCATE_SIZE; | |
101 | 11 context->code = (__code(**) (struct Context*)) NEWN(ALLOCATE_SIZE, void*); |
12 context->data = NEWN(ALLOCATE_SIZE, union Data*); | |
13 context->heapStart = NEWN(context->heapLimit, char); | |
14 context->heap = context->heapStart; | |
86 | 15 |
16 context->codeNum = Exit; | |
17 | |
186 | 18 #include "c/codeGearInit.c" |
178 | 19 |
186 | 20 #include "c/dataGearInit.c" |
101 | 21 |
170 | 22 context->data[D_ActiveQueue] = createSynchronizedQueue(context); |
23 context->data[D_WaitQueue] = createSynchronizedQueue(context); | |
109
059b26a250cc
Change put_queue process
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
101
diff
changeset
|
24 |
148
473b7d990a1f
fix data gears type enum
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
147
diff
changeset
|
25 context->dataNum = D_Queue; |
86 | 26 } |