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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
907c69e21e56 modify allocate
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
3 extern __code meta();
13
a765eb7f3b7c implement delete, traverse
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4
15
907c69e21e56 modify allocate
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
5 __code allocate(struct Context* context) {
907c69e21e56 modify allocate
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
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
907c69e21e56 modify allocate
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 13
diff changeset
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
ec4e7a81bddf modify allocate
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
11 context->heap += context->data[0]->allocate.size;
ec4e7a81bddf modify allocate
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
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 }