view src/parallel_execution/allocate.c @ 141:4f6a660c14a1 stack-interface

stack interface worked
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Wed, 09 Nov 2016 15:43:22 +0900
parents a747dc9d4da6
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);
}