comparison src/parallel_execution/context.h @ 149:63ab65b28466

Add Gearef macro
author one
date Thu, 10 Nov 2016 20:37:52 +0900
parents 473b7d990a1f
children 8c687b8fabf2 7164f59660d4
comparison
equal deleted inserted replaced
148:473b7d990a1f 149:63ab65b28466
32 32
33 #define GET_TYPE(dseg) ({ \ 33 #define GET_TYPE(dseg) ({ \
34 struct Meta* meta = (struct Meta*)(((void*)dseg) - sizeof(struct Meta));\ 34 struct Meta* meta = (struct Meta*)(((void*)dseg) - sizeof(struct Meta));\
35 meta->type; }) 35 meta->type; })
36 36
37 #define Gearef(context, t) (&(context)->data[D_##t]->t)
37 enum Code { 38 enum Code {
38 C_code1, 39 C_code1,
39 C_code2, 40 C_code2,
40 C_code3, 41 C_code3,
41 C_code4, 42 C_code4,
145 enum DataType type; 146 enum DataType type;
146 } meta; 147 } meta;
147 struct Time { 148 struct Time {
148 enum Code next; 149 enum Code next;
149 double time; 150 double time;
150 } time; 151 } Time;
151 struct LoopCounter { 152 struct LoopCounter {
152 int i; 153 int i;
153 } loopCounter; 154 } loopCounter;
154 struct Worker { 155 struct Worker {
155 int num; 156 int num;
223 struct Node* newNode; // writing node of new tree 224 struct Node* newNode; // writing node of new tree
224 struct Node* parent; 225 struct Node* parent;
225 struct Node* grandparent; 226 struct Node* grandparent;
226 struct Stack* nodeStack; 227 struct Stack* nodeStack;
227 int result; 228 int result;
228 } traverse; 229 } Traverse;
229 struct RotateTree { 230 struct RotateTree {
230 enum Code next; 231 enum Code next;
231 struct Traverse* traverse; 232 struct Traverse* traverse;
232 struct Tree* tree; 233 struct Tree* tree;
233 } rotateTree; 234 } rotateTree;
250 union Data **data; 251 union Data **data;
251 } ods; 252 } ods;
252 }; 253 };
253 254
254 // typedef struct RotateTree D_RotateTree; 255 // typedef struct RotateTree D_RotateTree;
256 typedef struct Time Time;
255 257
256 union MetaData { 258 union MetaData {
257 struct Queue waitMeTasks; 259 struct Queue waitMeTasks;
258 struct Queue waitI; 260 struct Queue waitI;
259 }; 261 };