Specify memory ordering
This commit is contained in:
@@ -303,21 +303,21 @@ int main() {
|
|||||||
auto x = mm.allocate();
|
auto x = mm.allocate();
|
||||||
mm.base[x].pointers[0] = 0;
|
mm.base[x].pointers[0] = 0;
|
||||||
mm.base[x].pointers[1] = 0;
|
mm.base[x].pointers[1] = 0;
|
||||||
mm.base[x].updated.store(false);
|
mm.base[x].updated.store(false, std::memory_order_relaxed);
|
||||||
});
|
});
|
||||||
mm.gc(nullptr, 0, 0);
|
mm.gc(nullptr, 0, 0);
|
||||||
for (int i = 0; i < 10000; ++i) {
|
for (int i = 0; i < 10000; ++i) {
|
||||||
auto x = mm.allocate();
|
auto x = mm.allocate();
|
||||||
mm.base[x].pointers[0] = 0;
|
mm.base[x].pointers[0] = 0;
|
||||||
mm.base[x].pointers[1] = 0;
|
mm.base[x].pointers[1] = 0;
|
||||||
mm.base[x].updated.store(false);
|
mm.base[x].updated.store(false, std::memory_order_relaxed);
|
||||||
}
|
}
|
||||||
auto root = mm.allocate();
|
auto root = mm.allocate();
|
||||||
mm.base[root].entry = weaselab::Entry::make(0, nullptr, 0, nullptr, 0,
|
mm.base[root].entry = weaselab::Entry::make(0, nullptr, 0, nullptr, 0,
|
||||||
weaselab::VersionedMap::Set);
|
weaselab::VersionedMap::Set);
|
||||||
mm.base[root].pointers[0] = 0;
|
mm.base[root].pointers[0] = 0;
|
||||||
mm.base[root].pointers[1] = 0;
|
mm.base[root].pointers[1] = 0;
|
||||||
mm.base[root].updated.store(false);
|
mm.base[root].updated.store(false, std::memory_order_relaxed);
|
||||||
bench.run("gc", [&]() { mm.gc(&root, 1, 0); });
|
bench.run("gc", [&]() { mm.gc(&root, 1, 0); });
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
Reference in New Issue
Block a user