Mercurial > hg > GearsTemplate
changeset 64:89d760486188
Add allocater to synchronizedQueue
author | Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 13 Jul 2015 23:22:12 +0900 |
parents | 2a40d697bf4e |
children | 025fd6e90597 |
files | src/synchronizedQueue/allocate.h |
diffstat | 1 files changed, 15 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/synchronizedQueue/allocate.h Mon Jul 13 23:22:12 2015 +0900 @@ -0,0 +1,15 @@ +__code allocate(); +__code meta_allocate(); +extern __code meta(); + +__code allocate(struct Context* context) { + goto meta_allocate(context); +} + + + +__code meta_allocate(struct Context* context) { + context->data[++context->dataNum] = context->heap; + context->heap += context->data[0]->allocate.size; + goto (context->code[context->data[0]->allocate.next])(context); +}