view src/parallel_execution/allocate.c @ 136:a747dc9d4da6

stack refactering no compile error
author mir3636
date Tue, 08 Nov 2016 15:01:08 +0900
parents a4507906938c
children 473b7d990a1f
line wrap: on
line source

#include "context.h"
#include "origin_cs.h"

union Data* allocator(struct Context* context) {
    context->data[++context->dataNum] = context->heap;
    context->heap += context->data[Allocate]->allocate.size;
    return context->data[context->dataNum];
}

__code allocatorCS(struct Context* context, struct Allocate* allocate) {
    context->data[++context->dataNum] = context->heap;
    context->heap += allocate->size;
    goto meta(context, allocate->next);
}

__code allocator_stub(struct Context* context) {
    goto allocatorCS(context, &context->data[Allocate]->allocate);
}