comparison 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
comparison
equal deleted inserted replaced
16:481760d44d87 17:1eb599acffe4
5 __code allocate(struct Context* context) { 5 __code allocate(struct Context* context) {
6 goto meta_allocate(context); 6 goto meta_allocate(context);
7 } 7 }
8 8
9 __code meta_allocate(struct Context* context) { 9 __code meta_allocate(struct Context* context) {
10 context->data[context->dataSize] = context->heap;
11 context->heap += sizeof(union Data);
10 context->dataSize++; 12 context->dataSize++;
11 goto (context->code[context->data[context->dataSize-1]->allocate.next])(context); 13 goto (context->code[context->data[context->dataSize-1]->allocate.next])(context);
12 } 14 }