annotate paper/source/allocate.h @ 8:bb5fab31cf41

add source file
author Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
date Tue, 05 May 2015 17:49:31 +0900
parents
children 92f7c78d8d6c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8
bb5fab31cf41 add source file
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 __code code1(struct Context* context) {
bb5fab31cf41 add source file
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 context->data[Allocate]->allocate.size = sizeof(struct Node);
bb5fab31cf41 add source file
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 context->data[Allocate]->allocate.next = Code2;
bb5fab31cf41 add source file
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 goto Allocate(context);
bb5fab31cf41 add source file
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 }
bb5fab31cf41 add source file
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6
bb5fab31cf41 add source file
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 __code allocate(struct Context* context) {
bb5fab31cf41 add source file
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 context->data[++context->dataNum] = context->heap;
bb5fab31cf41 add source file
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 context->heap += context->data[Allocate]->allocate.size;
bb5fab31cf41 add source file
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 goto (context->code[context->data[Allocate]->allocate.next])(context);
bb5fab31cf41 add source file
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 }
bb5fab31cf41 add source file
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12
bb5fab31cf41 add source file
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 __code code2(struct Context* context) {
bb5fab31cf41 add source file
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 // processing content
bb5fab31cf41 add source file
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 }