Mercurial > hg > GearsTemplate
view src/include/allocate.h @ 13:a765eb7f3b7c
implement delete, traverse
author | Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 07 Apr 2015 15:39:14 +0900 |
parents | |
children | 907c69e21e56 |
line wrap: on
line source
__code allocate(); __code meta_allocate(); __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); }