Mercurial > hg > GearsTemplate
changeset 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 | 9302b1a48008 |
files | src/allocate/allocateContext.c src/include/allocate.h |
diffstat | 2 files changed, 4 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/allocate/allocateContext.c Tue Apr 21 02:28:57 2015 +0900 +++ b/src/allocate/allocateContext.c Tue Apr 21 13:33:23 2015 +0900 @@ -16,5 +16,5 @@ context->dataSize = 0; context->data[context->dataSize] = context->heap; - context->dataSize++; + context->heap += sizeof(struct Allocate); }
--- a/src/include/allocate.h Tue Apr 21 02:28:57 2015 +0900 +++ b/src/include/allocate.h Tue Apr 21 13:33:23 2015 +0900 @@ -7,8 +7,7 @@ } __code meta_allocate(struct Context* context) { - context->data[context->dataSize] = context->heap; - context->heap += sizeof(union Data); - context->dataSize++; - goto (context->code[context->data[context->dataSize-1]->allocate.next])(context); + context->data[++context->dataSize] = context->heap; + context->heap += context->data[0]->allocate.size; + goto (context->code[context->data[0]->allocate.next])(context); }