comparison src/llrb/llrbContext.c @ 69:368306e1bfed

llrb deletion(not work).
author Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
date Tue, 20 Oct 2015 16:22:42 +0900
parents 025fd6e90597
children 5c4b9d116eda
comparison
equal deleted inserted replaced
66:a870c84acd0e 69:368306e1bfed
5 extern __code code1_stub(struct Context*); 5 extern __code code1_stub(struct Context*);
6 extern __code code2_stub(struct Context*); 6 extern __code code2_stub(struct Context*);
7 extern __code code3_stub(struct Context*); 7 extern __code code3_stub(struct Context*);
8 extern __code code4(struct Context*); 8 extern __code code4(struct Context*);
9 extern __code code5(struct Context*); 9 extern __code code5(struct Context*);
10 extern __code code6_stub(struct Context*); 10 extern __code find(struct Context*);
11 extern __code not_find(struct Context*);
12 extern __code code6(struct Context*);
11 extern __code meta(struct Context*); 13 extern __code meta(struct Context*);
12 extern __code put_stub(struct Context*); 14 extern __code put_stub(struct Context*);
13 extern __code replaceNode_stub(struct Context*); 15 extern __code replaceNode_stub(struct Context*);
14 extern __code insertNode_stub(struct Context*); 16 extern __code insertNode_stub(struct Context*);
15 extern __code rotateLeft_stub(struct Context*); 17 extern __code rotateLeft_stub(struct Context*);
16 extern __code rotateRight_stub(struct Context*); 18 extern __code rotateRight_stub(struct Context*);
17 extern __code colorFlip_stub(struct Context*); 19 extern __code colorFlip_stub(struct Context*);
18 extern __code fixUp_stub(struct Context*); 20 extern __code fixUp_stub(struct Context*);
19 extern __code changeReference_stub(struct Context*); 21 extern __code changeReference_stub(struct Context*);
20 extern __code get_stub(struct Context*); 22 extern __code get_stub(struct Context*);
21 extern __code traverse_stub(struct Context*); 23 extern __code delete_stub(struct Context*);
24 extern __code deleteMax_stub(struct Context*);
25 extern __code deleteMin_stub(struct Context*);
26 extern __code replaceNode_d_stub(struct Context*);
27 extern __code max_stub(struct Context*);
22 extern __code exit_code(struct Context*); 28 extern __code exit_code(struct Context*);
23 29
24 __code initLLRBContext(struct Context* context) { 30 __code initLLRBContext(struct Context* context) {
25 context->heapLimit = sizeof(union Data)*ALLOCATE_SIZE; 31 context->heapLimit = sizeof(union Data)*ALLOCATE_SIZE;
26 context->code = malloc(sizeof(__code*)*ALLOCATE_SIZE); 32 context->code = malloc(sizeof(__code*)*ALLOCATE_SIZE);
31 context->code[Code1] = code1_stub; 37 context->code[Code1] = code1_stub;
32 context->code[Code2] = code2_stub; 38 context->code[Code2] = code2_stub;
33 context->code[Code3] = code3_stub; 39 context->code[Code3] = code3_stub;
34 context->code[Code4] = code4; 40 context->code[Code4] = code4;
35 context->code[Code5] = code5; 41 context->code[Code5] = code5;
42 context->code[Find] = find;
43 context->code[Not_find] = not_find;
44 context->code[Code6] = code6;
36 context->code[Put] = put_stub; 45 context->code[Put] = put_stub;
37 context->code[Replace] = replaceNode_stub; 46 context->code[Replace] = replaceNode_stub;
38 context->code[Insert] = insertNode_stub; 47 context->code[Insert] = insertNode_stub;
39 context->code[RotateL] = rotateLeft_stub; 48 context->code[RotateL] = rotateLeft_stub;
40 context->code[RotateR] = rotateRight_stub; 49 context->code[RotateR] = rotateRight_stub;
41 context->code[ColorFlip] = colorFlip_stub; 50 context->code[ColorFlip] = colorFlip_stub;
42 context->code[FixUp] = fixUp_stub; 51 context->code[FixUp] = fixUp_stub;
43 context->code[ChangeRef] = changeReference_stub; 52 context->code[ChangeRef] = changeReference_stub;
53 context->code[Get] = get_stub;
54 context->code[Delete] = delete_stub;
55 context->code[DeleteMax] = deleteMax_stub;
56 // context->code[DeleteMin] = deleteMin_stub;
57 context->code[Replace_d] = replaceNode_d_stub;
58 context->code[Max] = max_stub;
44 context->code[Exit] = exit_code; 59 context->code[Exit] = exit_code;
45 60
46 context->heap = context->heapStart; 61 context->heap = context->heapStart;
47 62
48 context->data[Allocate] = context->heap; 63 context->data[Allocate] = context->heap;