Mercurial > hg > GearsTemplate
comparison src/include/allocate.h @ 18:ec4e7a81bddf
modify allocate
author | Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 21 Apr 2015 13:33:23 +0900 |
parents | 1eb599acffe4 |
children | 868c2918b634 |
comparison
equal
deleted
inserted
replaced
17:1eb599acffe4 | 18:ec4e7a81bddf |
---|---|
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; | 10 context->data[++context->dataSize] = context->heap; |
11 context->heap += sizeof(union Data); | 11 context->heap += context->data[0]->allocate.size; |
12 context->dataSize++; | 12 goto (context->code[context->data[0]->allocate.next])(context); |
13 goto (context->code[context->data[context->dataSize-1]->allocate.next])(context); | |
14 } | 13 } |