Fix firstGeq bug

This commit is contained in:
2024-05-09 13:48:52 -07:00
parent fbd5292478
commit 6baf069445

View File

@@ -936,9 +936,11 @@ void VersionedMap::Impl::firstGeq(const Key *key, const int64_t *version,
} else if (finger.backNode() == 0) {
iterator[i].impl->cmp = 1;
move<std::memory_order_acquire>(finger, version[i], true);
const auto &entry = *mm.base[finger.backNode()].entry;
iterator[i].impl->materializeClearEndingHere =
entry.clearTo() && entry.pointMutation();
if (finger.searchPathSize() > 0) {
const auto &entry = *mm.base[finger.backNode()].entry;
iterator[i].impl->materializeClearEndingHere =
entry.clearTo() && entry.pointMutation();
}
} else {
iterator[i].impl->cmp = 0;
}
@@ -1076,7 +1078,7 @@ int main() {
}
const int64_t v = 3;
cast(versionedMap)->printInOrder(v);
weaselab::VersionedMap::Key k = {(const uint8_t *)"aa", 2};
weaselab::VersionedMap::Key k = {(const uint8_t *)"zz", 2};
weaselab::VersionedMap::Iterator iter;
versionedMap.firstGeq(&k, &v, &iter, 1);
for (auto end = versionedMap.end(v); iter != end; ++iter) {