Mercurial > hg > Members > Moririn
annotate src/include/allocate.h @ 17:1eb599acffe4
modify allocate
author | Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 21 Apr 2015 02:28:57 +0900 |
parents | 907c69e21e56 |
children | ec4e7a81bddf |
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) { |
17 | 10 context->data[context->dataSize] = context->heap; |
11 context->heap += sizeof(union Data); | |
15 | 12 context->dataSize++; |
13 goto (context->code[context->data[context->dataSize-1]->allocate.next])(context); | |
13
a765eb7f3b7c
implement delete, traverse
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
14 } |