Mercurial > hg > Gears > GearsAgda
view src/parallel_execution/context.c @ 261:0cd43e22aee1
merge
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 28 Jan 2017 15:48:54 +0900 |
parents | 865179a0a56d |
children |
line wrap: on
line source
#include <stdlib.h> #include "context.h" #include "stack.h" #include "queue.h" #include "c/extern.h" __code initContext(struct Context* context) { context->heapLimit = sizeof(union Data)*ALLOCATE_SIZE; context->code = (__code(**) (struct Context*)) NEWN(ALLOCATE_SIZE, void*); context->data = NEWN(ALLOCATE_SIZE, union Data*); context->heapStart = NEWN(context->heapLimit, char); context->heap = context->heapStart; // context->codeNum = Exit; context->idgCount = 0; #include "c/codeGearInit.c" #include "c/dataGearInit.c" // context->data[D_ActiveQueue] = createSynchronizedQueue(context); // context->data[D_WaitQueue] = createSynchronizedQueue(context); context->dataNum = D_Queue; }