view 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
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 += sizeof(union Data);
    context->dataSize++;
    goto (context->code[context->data[context->dataSize-1]->allocate.next])(context);
}