Mercurial > hg > Members > Moririn
annotate src/include/allocate.h @ 23:868c2918b634
Non Destructive llrb
author | Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 30 Apr 2015 19:07:23 +0900 |
parents | ec4e7a81bddf |
children | c469c5ed5b4d |
rev | line source |
---|---|
13
a765eb7f3b7c
implement delete, traverse
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1 __code allocate(); |
a765eb7f3b7c
implement delete, traverse
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 __code meta_allocate(); |
15 | 3 extern __code meta(); |
13
a765eb7f3b7c
implement delete, traverse
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
4 |
15 | 5 __code allocate(struct Context* context) { |
6 goto meta_allocate(context); | |
13
a765eb7f3b7c
implement delete, traverse
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
7 } |
a765eb7f3b7c
implement delete, traverse
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
8 |
15 | 9 __code meta_allocate(struct Context* context) { |
23
868c2918b634
Non Destructive llrb
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
18
diff
changeset
|
10 context->data[++context->dataNum] = context->heap; |
18 | 11 context->heap += context->data[0]->allocate.size; |
12 goto (context->code[context->data[0]->allocate.next])(context); | |
13
a765eb7f3b7c
implement delete, traverse
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
13 } |