Mercurial > hg > Papers > 2018 > nozomi-master
diff paper/src/context.h @ 18:415fa6d79d00
Add GearsOS description
author | atton <atton@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 20 Jan 2017 14:39:45 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/paper/src/context.h Fri Jan 20 14:39:45 2017 +0900 @@ -0,0 +1,47 @@ +/* Context definition */ + +#define ALLOCATE_SIZE 1024 + +enum Code { + Code1, + Code2, + Allocator, +}; + +enum UniqueData { + Allocate, + Tree, +}; + +struct Context { + int codeNum; + __code (**code) (struct Context *); + void* heap_start; + void* heap; + long dataSize; + int dataNum; + union Data **data; +}; + +union Data { + struct Tree { + union Data* root; + union Data* current; + union Data* prev; + int result; + } tree; + struct Node { + int key; + int value; + enum Color { + Red, + Black, + } color; + union Data* left; + union Data* right; + } node; + struct Allocate { + long size; + enum Code next; + } allocate; +};