Mercurial > hg > Papers > 2018 > ryokka-sigos
view Paper/src/context.c @ 12:e20725cd6d8a default tip
fix slides
author | ryokka |
---|---|
date | Mon, 21 May 2018 00:29:29 +0900 |
parents | a5facba1adbc |
children |
line wrap: on
line source
#include <stdlib.h> #include "context.h" extern __code code1_stub(struct Context*); extern __code code2_stub(struct Context*); extern __code code3_stub(struct Context*); __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->code[Code1] = code1_stub; context->code[Code2] = code2_stub; context->code[Code3] = code3_stub; #include "dataGearInit.c" context->dataNum = 39; context->tasks = createSingleLinkedQueue(context); }