X-Git-Url: http://plrg.eecs.uci.edu/git/?p=model-checker-benchmarks.git;a=blobdiff_plain;f=spsc-queue%2Fqueue.h;h=c77425f5b662f1de1982e9738ede23bcff4e4a07;hp=7a6f29e80c60bd6d9f9b0ef6e5571aae5501db4e;hb=993e7e5146f39ff0ed459ac0a8bc30e7a0253156;hpb=91cb95bde87d2b7023fc2d2e344fba24e6dbca70 diff --git a/spsc-queue/queue.h b/spsc-queue/queue.h index 7a6f29e..c77425f 100644 --- a/spsc-queue/queue.h +++ b/spsc-queue/queue.h @@ -1,4 +1,5 @@ #include +#include #include "eventcount.h" @@ -8,7 +9,7 @@ class spsc_queue public: spsc_queue() { - node* n = RL_NEW node (); + node* n = new node (); head = n; tail = n; } @@ -16,12 +17,12 @@ public: ~spsc_queue() { RL_ASSERT(head == tail); - RL_DELETE((node*)head($)); + delete ((node*)head($)); } void enqueue(T data) { - node* n = RL_NEW node (data); + node* n = new node (data); head($)->next.store(n, std::memory_order_release); head = n; ec.signal_relaxed(); @@ -51,9 +52,10 @@ private: rl::var data; node(T data = T()) - : next(0) - , data(data) - {} + : data(data) + { + next = 0; + } }; rl::var head; @@ -68,7 +70,7 @@ private: if (0 == n) return 0; T data = n->data($); - RL_DELETE(t); + delete (t); tail = n; return data; }