# HG changeset patch # User Shohei KOKUBO # Date 1449814030 -32400 # Node ID 69d0637e52fd1cb5411ed0fa716d676fc9c38243 # Parent dc6f665bb753bd24f7ca120d5420c6b40244b218# Parent ed9d6438d2a57a65f1a3a187b6bde78a921b7dac merge diff -r dc6f665bb753 -r 69d0637e52fd src/synchronizedQueue/CMakeLists.txt --- a/src/synchronizedQueue/CMakeLists.txt Fri Dec 11 15:06:20 2015 +0900 +++ b/src/synchronizedQueue/CMakeLists.txt Fri Dec 11 15:07:10 2015 +0900 @@ -3,6 +3,7 @@ add_executable(synchronizedQueueForCas synchronizedQueueForCas.c synchronizedQueueContext.c + origin_cs.c ) #add_executable(synchronizedQueue diff -r dc6f665bb753 -r 69d0637e52fd src/synchronizedQueue/origin_cs.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/synchronizedQueue/origin_cs.c Fri Dec 11 15:07:10 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 dc6f665bb753 -r 69d0637e52fd src/synchronizedQueue/synchronizedQueue.c --- a/src/synchronizedQueue/synchronizedQueue.c Fri Dec 11 15:06:20 2015 +0900 +++ b/src/synchronizedQueue/synchronizedQueue.c Fri Dec 11 15:07:10 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 dc6f665bb753 -r 69d0637e52fd src/synchronizedQueue/synchronizedQueueForCas.c --- a/src/synchronizedQueue/synchronizedQueueForCas.c Fri Dec 11 15:06:20 2015 +0900 +++ b/src/synchronizedQueue/synchronizedQueueForCas.c Fri Dec 11 15:07:10 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);