view src/parallel_execution/allocate.c @ 195:119c035e0e36

replace Array and Stack for array and stack
author ikkun
date Fri, 16 Dec 2016 23:27:14 +0900
parents 473b7d990a1f
children c34e6aa10967
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[D_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[D_Allocate]->allocate);
}