# HG changeset patch # User Tatsuki IHA # Date 1449219454 -32400 # Node ID 765ee56d68f1c2bd4f1d39c69026f970f0cce4a5 # Parent 618c03f25108cc35cdbdc2a8e660eb05fc7bef58 Add origin_cs to synchronizedQueue diff -r 618c03f25108 -r 765ee56d68f1 src/synchronizedQueue/origin_cs.c --- /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 +#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); +} diff -r 618c03f25108 -r 765ee56d68f1 src/synchronizedQueue/synchronizedQueue.c --- 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); diff -r 618c03f25108 -r 765ee56d68f1 src/synchronizedQueue/synchronizedQueueForCas.c --- 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);