28
|
1 __code meta(struct Context* context, enum Code next) {
|
|
2 struct Iterator* iter = &context->data[Iter]->iterator;
|
|
3
|
|
4 switch (context->prev) {
|
|
5 case GoToPreviousDepth:
|
|
6 if (iter->iteratedPointDataNum == 0) break;
|
|
7 if (iter->iteratedPointHeap == NULL) break;
|
|
8
|
|
9 unsigned int diff =(unsigned long)context->heap - (unsigned long)iter->iteratedPointHeap;
|
|
10 memset(iter->iteratedPointHeap, 0, diff);
|
|
11 context->dataNum = iter->iteratedPointDataNum;
|
|
12 context->heap = iter->iteratedPointHeap;
|
|
13 break;
|
|
14 default:
|
|
15 break;
|
|
16 }
|
|
17 switch (next) {
|
|
18 case PutAndGoToNextDepth: // with assert check
|
|
19 if (context->prev == GoToPreviousDepth) break;
|
|
20 if (iter->previousDepth == NULL) break;
|
|
21 iter->previousDepth->iteratedPointDataNum = context->dataNum;
|
|
22 iter->previousDepth->iteratedPointHeap = context->heap;
|
|
23 break;
|
|
24 default:
|
|
25 break;
|
|
26 }
|
|
27
|
|
28 context->prev = next;
|
|
29 goto (context->code[next])(context);
|
|
30 }
|
|
31
|