projects
/
model-checker-benchmarks.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
changes
[model-checker-benchmarks.git]
/
spsc-queue
/
queue.h
diff --git
a/spsc-queue/queue.h
b/spsc-queue/queue.h
index 7a6f29e80c60bd6d9f9b0ef6e5571aae5501db4e..c77425f5b662f1de1982e9738ede23bcff4e4a07 100644
(file)
--- a/
spsc-queue/queue.h
+++ b/
spsc-queue/queue.h
@@
-1,4
+1,5
@@
#include <unrelacy.h>
#include <unrelacy.h>
+#include <atomic>
#include "eventcount.h"
#include "eventcount.h"
@@
-8,7
+9,7
@@
class spsc_queue
public:
spsc_queue()
{
public:
spsc_queue()
{
- node* n =
RL_NEW
node ();
+ node* n =
new
node ();
head = n;
tail = n;
}
head = n;
tail = n;
}
@@
-16,12
+17,12
@@
public:
~spsc_queue()
{
RL_ASSERT(head == tail);
~spsc_queue()
{
RL_ASSERT(head == tail);
-
RL_DELETE
((node*)head($));
+
delete
((node*)head($));
}
void enqueue(T data)
{
}
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();
head($)->next.store(n, std::memory_order_release);
head = n;
ec.signal_relaxed();
@@
-51,9
+52,10
@@
private:
rl::var<T> data;
node(T data = T())
rl::var<T> data;
node(T data = T())
- : next(0)
- , data(data)
- {}
+ : data(data)
+ {
+ next = 0;
+ }
};
rl::var<node*> head;
};
rl::var<node*> head;
@@
-68,7
+70,7
@@
private:
if (0 == n)
return 0;
T data = n->data($);
if (0 == n)
return 0;
T data = n->data($);
-
RL_DELETE
(t);
+
delete
(t);
tail = n;
return data;
}
tail = n;
return data;
}