# HG changeset patch # User matac42 # Date 1699759196 -32400 # Node ID 9b2f5dc02b2a330df4cedd65d909c8f2675261c5 # Parent cf2aa790afe7573c0f1e2b3adac1f3a35a86b3aa ... diff -r cf2aa790afe7 -r 9b2f5dc02b2a src/parallel_execution/RedBlackTree.cbc --- a/src/parallel_execution/RedBlackTree.cbc Sun Nov 12 12:01:57 2023 +0900 +++ b/src/parallel_execution/RedBlackTree.cbc Sun Nov 12 12:19:56 2023 +0900 @@ -140,19 +140,20 @@ } else { node->right = newNode; newNode = node; - goto nodeStack->isEmpty(popWhenNoEmpty, next(...)); + goto nodeStack->isEmpty(popWhenNoEmpty, popWhenEmpty); } } +__code popWhenEmpty(struct Node* node, struct RedBlackTree* tree, struct Stack* inputStack, struct Stack* outputStack) { + struct Stack* nodeStack = tree->nodeStack; + goto next(...); +} + __code popWhenNoEmpty(struct Node* node, struct RedBlackTree* tree, struct Stack* inputStack, struct Stack* outputStack) { struct Stack* nodeStack = tree->nodeStack; goto nodeStack->pop(up1); } -__code popWhenEmpty(struct Node* node, struct RedBlackTree* tree, struct Stack* inputStack, struct Stack* outputStack) { - -} - __code up1(struct Node* node, struct RedBlackTree* tree, struct Stack* inputStack, struct Stack* outputStack) { struct Stack* nodeStack = tree->nodeStack; goto nodeStack->pop(up2); diff -r cf2aa790afe7 -r 9b2f5dc02b2a src/parallel_execution/Tree.h --- a/src/parallel_execution/Tree.h Sun Nov 12 12:01:57 2023 +0900 +++ b/src/parallel_execution/Tree.h Sun Nov 12 12:19:56 2023 +0900 @@ -1,12 +1,13 @@ -typedef struct Tree<>{ - /* future Code */ - /* Type* tree; */ - /* Type* node; */ - union Data* tree; - struct Node* node; - __code put(Impl* tree,Type* node, __code next(...)); - __code get(Impl* tree, Type* node, __code next(...)); - __code remove(Impl* tree,Type* node, __code next(...)); - // __code clearRedBlackTree(); - __code next(...); +typedef struct Tree<> { + /* future Code */ + /* Type* tree; */ + /* Type* node; */ + union Data *tree; + struct Node *node; + __code put(Impl *tree, Type *node, __code next(...)); + __code get(Impl *tree, Type *node, __code next(...)); + __code remove(Impl *tree, Type *node, __code next(...)); + __code copy(Impl *tree, Type *node, __code next(...)); + // __code clearRedBlackTree(); + __code next(...); } Tree; diff -r cf2aa790afe7 -r 9b2f5dc02b2a src/parallel_execution/test/rbTreeCopy_test.cbc --- a/src/parallel_execution/test/rbTreeCopy_test.cbc Sun Nov 12 12:01:57 2023 +0900 +++ b/src/parallel_execution/test/rbTreeCopy_test.cbc Sun Nov 12 12:19:56 2023 +0900 @@ -1,6 +1,7 @@ #include #interface "Tree.h" + /* #include */ __code rbTreeTest1(struct Tree* tree) { @@ -70,7 +71,7 @@ printf("test5\n"); Node* node = new Node(); node->value = (union Data*)new Integer(); - goto tree->copy(exit_code); + goto tree->copy(node, exit_code); } __code rbTreeTest5_stub(struct Context* context) {