annotate src/synchronizedQueue/allocate.h @ 64:89d760486188

Add allocater to synchronizedQueue
author Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
date Mon, 13 Jul 2015 23:22:12 +0900
parents
children a870c84acd0e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
64
89d760486188 Add allocater to synchronizedQueue
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 __code allocate();
89d760486188 Add allocater to synchronizedQueue
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 __code meta_allocate();
89d760486188 Add allocater to synchronizedQueue
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 extern __code meta();
89d760486188 Add allocater to synchronizedQueue
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4
89d760486188 Add allocater to synchronizedQueue
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 __code allocate(struct Context* context) {
89d760486188 Add allocater to synchronizedQueue
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 goto meta_allocate(context);
89d760486188 Add allocater to synchronizedQueue
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 }
89d760486188 Add allocater to synchronizedQueue
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8
89d760486188 Add allocater to synchronizedQueue
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9
89d760486188 Add allocater to synchronizedQueue
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10
89d760486188 Add allocater to synchronizedQueue
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 __code meta_allocate(struct Context* context) {
89d760486188 Add allocater to synchronizedQueue
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 context->data[++context->dataNum] = context->heap;
89d760486188 Add allocater to synchronizedQueue
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 context->heap += context->data[0]->allocate.size;
89d760486188 Add allocater to synchronizedQueue
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 goto (context->code[context->data[0]->allocate.next])(context);
89d760486188 Add allocater to synchronizedQueue
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 }