Mercurial > hg > Members > Moririn
view src/allocate/allocate.c @ 8:714d0ce1efd7
change configuring directory
author | Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 01 Apr 2015 22:56:51 +0900 |
parents | src/allocate.c@ad48a076a8e5 |
children |
line wrap: on
line source
#include <stdlib.h> #include "allocate.h" __code allocate(Context* context, int size, int num, __code (*next)()) { goto meta_allocate(context, size, num, next); } __code meta_allocate(Context* context, int size, int num, __code (*next)()) { context->next = next; void* ds = context->ds; context->ds += size*num; ((mdata*)context->mds)->ds = ds; ((mdata*)context->mds)->size = size; context->mds = (mdata*)context->mds+1; goto context->next(context, (data1*)ds, 0); }