diff src/parallel_execution/context.c @ 131:a4507906938c

Fix compile error but not work
author Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
date Tue, 25 Oct 2016 00:49:28 +0900
parents 2bb5e4f0fd35
children 7c309e1aea73
line wrap: on
line diff
--- a/src/parallel_execution/context.c	Mon Oct 10 20:19:26 2016 +0900
+++ b/src/parallel_execution/context.c	Tue Oct 25 00:49:28 2016 +0900
@@ -60,6 +60,8 @@
 extern __code putQueue3_stub(struct Context*);
 extern __code putQueue4_stub(struct Context*);
 extern __code getQueue_stub(struct Context*);
+extern __code pushSingleLinkedStack_stub(struct Context*);
+extern __code popSingleLinkedStack_stub(struct Context*);
 extern __code spawnTask_stub(struct Context*);
 extern __code twice_stub(struct Context*);
 extern __code start_time_stub(struct Context*);
@@ -129,6 +131,8 @@
     context->code[PutQueue3]     = putQueue3_stub;
     context->code[PutQueue4]     = putQueue4_stub;
     context->code[GetQueue]      = getQueue_stub;
+    context->code[PushSingleLinkedStack] = pushSingleLinkedStack_stub;
+    context->code[PopSingleLinkedStack] = popSingleLinkedStack_stub;
     context->code[SpawnTask]     = spawnTask_stub;
     context->code[Twice]         = twice_stub;
     context->code[StartTime]     = start_time_stub;
@@ -142,11 +146,15 @@
     struct Allocate* allocate = ALLOC_DATA(context, Allocate);
     allocate->size = 0;
 
-    struct SingleLinkedStack* stack = ALLOC_DATA(context, SignleLinkedStack);
-    stack->top = NULL;
-    stack->i.push = _;
-    stack->i.pop = _;
-    stack->i.isEmpty = _;
+    
+    struct SingleLinkedStack* singleLinkedStack = ALLOC_DATA(context, SingleLinkedStack);
+    singleLinkedStack->top = NULL;
+    singleLinkedStack->i.push = PushSingleLinkedStack;
+    singleLinkedStack->i.pop = PopSingleLinkedStack;
+    singleLinkedStack->i.isEmpty = NULL;
+    singleLinkedStack->i.stack = (union StackSelf*)singleLinkedStack;
+
+    context->data[Stack] = (union Data*)&singleLinkedStack->i;
 
     struct Tree* tree = ALLOC_DATA(context, Tree);
     tree->root = 0;