Mercurial > hg > Papers > 2016 > kkb-master
comparison src/context.h @ 5:910e143c28e7
modify style
author | Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 09 Feb 2016 17:10:44 +0900 |
parents | 52eec0b77576 |
children |
comparison
equal
deleted
inserted
replaced
4:52eec0b77576 | 5:910e143c28e7 |
---|---|
1 /* Context definition example */ | 1 /* Context definition example */ |
2 #define ALLOCATE_SIZE 1000 | 2 #define ALLOCATE_SIZE 1000 |
3 | 3 |
4 // Code Gear Name | |
4 enum Code { | 5 enum Code { |
5 Code1, | 6 Code1, |
6 Code2, | 7 Code2, |
7 Allocator, | 8 Allocator, |
8 Exit, | 9 Exit, |
9 }; | 10 }; |
10 | 11 |
12 // Unique Data Gear | |
11 enum UniqueData { | 13 enum UniqueData { |
12 Allocate, | 14 Allocate, |
13 }; | 15 }; |
14 | 16 |
15 struct Context { | 17 struct Context { |
21 long heapLimit; | 23 long heapLimit; |
22 int dataNum; | 24 int dataNum; |
23 union Data **data; | 25 union Data **data; |
24 }; | 26 }; |
25 | 27 |
28 // Data Gear definition | |
26 union Data { | 29 union Data { |
30 // size: 4 byte | |
27 struct Data1 { | 31 struct Data1 { |
28 int i; | 32 int i; |
29 } data1; | 33 } data1; |
34 // size: 5 byte | |
30 struct Data2 { | 35 struct Data2 { |
31 int i; | 36 int i; |
32 char c; | 37 char c; |
33 } data2; | 38 } data2; |
39 // size: 8 byte | |
34 struct Allocate { | 40 struct Allocate { |
35 long size; | 41 long size; |
36 } allocate; | 42 } allocate; |
37 }; | 43 }; |