view 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
line wrap: on
line source

__code allocate();
__code meta_allocate();
extern __code meta();

__code allocate(struct Context* context) {
    goto meta_allocate(context);
}

__code meta_allocate(struct Context* context) {
    context->data[++context->dataSize] = context->heap;
    context->heap += context->data[0]->allocate.size;
    goto (context->code[context->data[0]->allocate.next])(context);
}