comparison src/llrb/llrbContext.c @ 19:9302b1a48008

add llrb
author Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
date Tue, 21 Apr 2015 22:36:23 +0900
parents
children 324c44f2076f
comparison
equal deleted inserted replaced
18:ec4e7a81bddf 19:9302b1a48008
1 #include "llrbContext.h"
2 extern __code code1(struct Context*);
3 extern __code code2(struct Context*);
4 extern __code meta(struct Context*);
5 extern __code allocate(struct Context*);
6 extern __code put(struct Context*);
7 extern __code insert(struct Context*);
8 extern __code exit_code(struct Context*);
9
10 __code initLLRBContext(struct Context* context) {
11 context->codeSize = 3;
12 context->code[Code1] = code1;
13 context->code[Code2] = code2;
14 context->code[Allocate] = allocate;
15 context->code[Put] = put;
16 context->code[Insert] = insert;
17 context->code[Exit] = exit_code;
18
19 context->dataSize = 0;
20 context->data[context->dataSize] = context->heap;
21 context->heap += sizeof(struct Allocate);
22 }