Mercurial > hg > GearsTemplate
changeset 78:765ee56d68f1
Add origin_cs to synchronizedQueue
author | Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 04 Dec 2015 17:57:34 +0900 |
parents | 618c03f25108 |
children | ed9d6438d2a5 |
files | src/synchronizedQueue/origin_cs.c src/synchronizedQueue/synchronizedQueue.c src/synchronizedQueue/synchronizedQueueForCas.c |
diffstat | 3 files changed, 17 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/synchronizedQueue/origin_cs.c Fri Dec 04 17:57:34 2015 +0900 @@ -0,0 +1,17 @@ +#include <stdlib.h> +#include "synchronizedQueueContext.h" + +__code meta(struct Context* context, enum Code next) { + goto (context->code[next])(context); +} + +__code start_code(struct Context* context, enum Code next) { + goto meta(context, next); +} + +__code exit_code(struct Context* context) { + free(context->code); + free(context->data); + free(context->heapStart); + goto exit(0); +}
--- a/src/synchronizedQueue/synchronizedQueue.c Fri Nov 27 02:14:25 2015 +0900 +++ b/src/synchronizedQueue/synchronizedQueue.c Fri Dec 04 17:57:34 2015 +0900 @@ -16,10 +16,6 @@ extern __code initSynchronizedQueueContext(struct Context* context); extern void allocator(struct Context* context); -__code meta(struct Context* context, enum Code next) { - goto (context->code[next])(context); -} - //__code code1(struct Context* context) { // context->data[Allocate]->allocate.size = sizeof(struct Element); // goto code2(context);
--- a/src/synchronizedQueue/synchronizedQueueForCas.c Fri Nov 27 02:14:25 2015 +0900 +++ b/src/synchronizedQueue/synchronizedQueueForCas.c Fri Dec 04 17:57:34 2015 +0900 @@ -17,10 +17,6 @@ extern void allocator(struct Context* context); -__code meta(struct Context* context, enum Code next) { - goto (context->code[next])(context); -} - //__code code1(struct Context* context) { // context->data[Allocate]->allocate.size = sizeof(struct Element); // goto code2(context);