@@ -28,8 +28,8 @@ namespace Robustness {
28
28
};
29
29
// ! Location component
30
30
struct Location {
31
- timestamp_t stamp = 0 ;
32
- timestamp_t stampu = 0 ;
31
+ timestamp_t stamp = kEpochZero ;
32
+ timestamp_t stampu = kEpochZero ;
33
33
VectorClock m, w;
34
34
VectorClock mu, wu;
35
35
};
@@ -53,12 +53,12 @@ namespace Robustness {
53
53
* Memory order is ignored for SC
54
54
*/
55
55
void updateStoreStatement (ThreadId , LocationId a, Thread &ts, Location &ls, morder, u64 val){
56
- ls.m |= timestamp (a, ++ ls.stamp );
56
+ ls.m |= timestamp (a, EpochInc ( ls.stamp ) );
57
57
ts.v |= ls.m ;
58
58
ls.w = ts.v ;
59
59
ls.m = ts.v ;
60
60
61
- ls.mu |= timestamp (a, ++ ls.stampu );
61
+ ls.mu |= timestamp (a, EpochInc ( ls.stampu ) );
62
62
ts.vu |= ls.mu ;
63
63
ls.wu = ts.vu ;
64
64
ls.mu = ts.vu ;
@@ -71,7 +71,7 @@ namespace Robustness {
71
71
*/
72
72
void updateRmwStatement (ThreadId t, LocationId a, Thread &ts, Location &ls, morder mo, u64 val){
73
73
// return updateStoreStatement(t, a, ts, ls, mo);
74
- ls.m |= timestamp (a, ++ ls.stamp );
74
+ ls.m |= timestamp (a, EpochInc ( ls.stamp ) );
75
75
ts.v |= ls.m ;
76
76
ls.w = ts.v ;
77
77
ls.m = ts.v ;
@@ -91,12 +91,6 @@ namespace Robustness {
91
91
timestamp_t getLastTimeStampU (ThreadId , LocationId l, Thread &ts, Location &ls) const {
92
92
return ts.vu [l].ts ;
93
93
}
94
- timestamp_t getLastTimeStampV (ThreadId , LocationId l, Thread &ts, Location &ls, u64 val) const {
95
- return ts.v [l].ts - 1 ;
96
- }
97
- timestamp_t getLastTimeStampUV (ThreadId , LocationId l, Thread &ts, Location &ls, u64 val) const {
98
- return ts.vu [l].ts - 1 ;
99
- }
100
94
101
95
// ! Remove locations when freeing memory
102
96
void freeLocation (LocationId l, Location &ls){
@@ -138,7 +132,7 @@ namespace Robustness {
138
132
};
139
133
// ! Location component
140
134
struct Location {
141
- timestamp_t writeStamp = 0 , writeStampU = 0 ;
135
+ timestamp_t writeStamp = kEpochZero , writeStampU = kEpochZero ;
142
136
VectorClock w;
143
137
VectorClock wu;
144
138
};
@@ -162,8 +156,8 @@ namespace Robustness {
162
156
163
157
// ! Update store statement
164
158
void updateStoreStatement (ThreadId t, LocationId a, Thread &ts, Location &ls, morder mo, uint64_t oldValue){
165
- const auto timestampV = timestamp (a, ++ ls.writeStamp );
166
- const auto timestampVU = timestamp (a, ++ ls.writeStampU );
159
+ const auto timestampV = timestamp (a, EpochInc ( ls.writeStamp ) );
160
+ const auto timestampVU = timestamp (a, EpochInc ( ls.writeStampU ) );
167
161
ls.w |= timestampV;
168
162
ls.wu |= timestampVU;
169
163
ts.va |= timestampV;
@@ -185,7 +179,7 @@ namespace Robustness {
185
179
186
180
// ! Update RMW statement
187
181
void updateRmwStatement (ThreadId t, LocationId a, Thread &ts, Location &ls, morder mo, uint64_t oldValue){
188
- const auto timestampV = timestamp (a, ++ ls.writeStamp );
182
+ const auto timestampV = timestamp (a, EpochInc ( ls.writeStamp ) );
189
183
ls.w |= timestampV;
190
184
ts.va |= timestampV;
191
185
ts.vc |= timestampV;
0 commit comments