Remove cmp for now
This commit is contained in:
@@ -890,7 +890,6 @@ struct VersionedMap::Iterator::Impl {
|
|||||||
Finger finger;
|
Finger finger;
|
||||||
int64_t version;
|
int64_t version;
|
||||||
const VersionedMap::Impl *map;
|
const VersionedMap::Impl *map;
|
||||||
int cmp;
|
|
||||||
|
|
||||||
// State for materializing mutations associated with the entry at `finger`.
|
// State for materializing mutations associated with the entry at `finger`.
|
||||||
// Cases:
|
// Cases:
|
||||||
@@ -904,7 +903,6 @@ struct VersionedMap::Iterator::Impl {
|
|||||||
VersionedMutation mutations[2];
|
VersionedMutation mutations[2];
|
||||||
|
|
||||||
void copyTo(Impl &result) {
|
void copyTo(Impl &result) {
|
||||||
result.cmp = cmp;
|
|
||||||
result.map = map;
|
result.map = map;
|
||||||
result.version = version;
|
result.version = version;
|
||||||
result.mutationCount = mutationCount;
|
result.mutationCount = mutationCount;
|
||||||
@@ -1026,7 +1024,6 @@ void materializeMutations(VersionedMap::Iterator::Impl *impl, const Entry *prev,
|
|||||||
}
|
}
|
||||||
|
|
||||||
VersionedMap::Iterator &VersionedMap::Iterator::operator++() {
|
VersionedMap::Iterator &VersionedMap::Iterator::operator++() {
|
||||||
impl->cmp = 1;
|
|
||||||
|
|
||||||
if (impl->mutationIndex < impl->mutationCount - 1) {
|
if (impl->mutationIndex < impl->mutationCount - 1) {
|
||||||
++impl->mutationIndex;
|
++impl->mutationIndex;
|
||||||
@@ -1054,7 +1051,6 @@ VersionedMap::Iterator VersionedMap::Iterator::operator++(int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
VersionedMap::Iterator &VersionedMap::Iterator::operator--() {
|
VersionedMap::Iterator &VersionedMap::Iterator::operator--() {
|
||||||
impl->cmp = -1;
|
|
||||||
|
|
||||||
if (impl->mutationIndex > 0) {
|
if (impl->mutationIndex > 0) {
|
||||||
--impl->mutationIndex;
|
--impl->mutationIndex;
|
||||||
@@ -1135,16 +1131,17 @@ void VersionedMap::Impl::firstGeq(const Key *key, const int64_t *version,
|
|||||||
Finger &finger = iterator[i].impl->finger;
|
Finger &finger = iterator[i].impl->finger;
|
||||||
search<std::memory_order_acquire>(key[i], root, version[i], finger);
|
search<std::memory_order_acquire>(key[i], root, version[i], finger);
|
||||||
|
|
||||||
|
bool exact;
|
||||||
if (finger.searchPathSize() == 0) {
|
if (finger.searchPathSize() == 0) {
|
||||||
iterator[i].impl->cmp = 1;
|
exact = false;
|
||||||
} else if (finger.backNode() == 0) {
|
} else if (finger.backNode() == 0) {
|
||||||
iterator[i].impl->cmp = 1;
|
exact = false;
|
||||||
move<std::memory_order_acquire>(finger, version[i], true);
|
move<std::memory_order_acquire>(finger, version[i], true);
|
||||||
if (finger.searchPathSize() > 0) {
|
if (finger.searchPathSize() > 0) {
|
||||||
assert(finger.backNode() != 0);
|
assert(finger.backNode() != 0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
iterator[i].impl->cmp = 0;
|
exact = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
iterator[i].impl->version = version[i];
|
iterator[i].impl->version = version[i];
|
||||||
@@ -1164,7 +1161,7 @@ void VersionedMap::Impl::firstGeq(const Key *key, const int64_t *version,
|
|||||||
iterator[i].impl->map->move<std::memory_order_acquire>(
|
iterator[i].impl->map->move<std::memory_order_acquire>(
|
||||||
finger, iterator[i].impl->version, true);
|
finger, iterator[i].impl->version, true);
|
||||||
}
|
}
|
||||||
if (iterator[i].impl->cmp == 0) {
|
if (exact) {
|
||||||
iterator[i].impl->mutationIndex = iterator[i].impl->mutationCount - 1;
|
iterator[i].impl->mutationIndex = iterator[i].impl->mutationCount - 1;
|
||||||
} else {
|
} else {
|
||||||
iterator[i].impl->mutationIndex = 0;
|
iterator[i].impl->mutationIndex = 0;
|
||||||
@@ -1179,8 +1176,6 @@ bool VersionedMap::Iterator::operator!=(const Iterator &other) const {
|
|||||||
return !impl->equals(*other.impl);
|
return !impl->equals(*other.impl);
|
||||||
}
|
}
|
||||||
|
|
||||||
int VersionedMap::Iterator::cmp() const { return impl->cmp; }
|
|
||||||
|
|
||||||
void VersionedMap::firstGeq(const Key *key, const int64_t *version,
|
void VersionedMap::firstGeq(const Key *key, const int64_t *version,
|
||||||
Iterator *iterator, int count) const {
|
Iterator *iterator, int count) const {
|
||||||
impl->firstGeq(key, version, iterator, count);
|
impl->firstGeq(key, version, iterator, count);
|
||||||
@@ -1189,7 +1184,6 @@ void VersionedMap::firstGeq(const Key *key, const int64_t *version,
|
|||||||
VersionedMap::Iterator VersionedMap::begin(int64_t version) const {
|
VersionedMap::Iterator VersionedMap::begin(int64_t version) const {
|
||||||
VersionedMap::Iterator result;
|
VersionedMap::Iterator result;
|
||||||
result.impl = new (safe_malloc(sizeof(Iterator::Impl))) Iterator::Impl();
|
result.impl = new (safe_malloc(sizeof(Iterator::Impl))) Iterator::Impl();
|
||||||
result.impl->cmp = 1;
|
|
||||||
|
|
||||||
bool ignored;
|
bool ignored;
|
||||||
result.impl->finger.push(
|
result.impl->finger.push(
|
||||||
@@ -1228,7 +1222,6 @@ VersionedMap::Iterator VersionedMap::begin(int64_t version) const {
|
|||||||
VersionedMap::Iterator VersionedMap::end(int64_t version) const {
|
VersionedMap::Iterator VersionedMap::end(int64_t version) const {
|
||||||
VersionedMap::Iterator result;
|
VersionedMap::Iterator result;
|
||||||
result.impl = new (safe_malloc(sizeof(Iterator::Impl))) Iterator::Impl();
|
result.impl = new (safe_malloc(sizeof(Iterator::Impl))) Iterator::Impl();
|
||||||
result.impl->cmp = 1;
|
|
||||||
result.impl->map = impl;
|
result.impl->map = impl;
|
||||||
result.impl->mutationIndex = 0;
|
result.impl->mutationIndex = 0;
|
||||||
result.impl->version = version;
|
result.impl->version = version;
|
||||||
|
@@ -23,7 +23,6 @@ __ZNK8weaselab12VersionedMap10getVersionEv
|
|||||||
__ZNK8weaselab12VersionedMap16getOldestVersionEv
|
__ZNK8weaselab12VersionedMap16getOldestVersionEv
|
||||||
__ZNK8weaselab12VersionedMap3endEx
|
__ZNK8weaselab12VersionedMap3endEx
|
||||||
__ZNK8weaselab12VersionedMap5beginEx
|
__ZNK8weaselab12VersionedMap5beginEx
|
||||||
__ZNK8weaselab12VersionedMap8Iterator3cmpEv
|
|
||||||
__ZNK8weaselab12VersionedMap8IteratordeEv
|
__ZNK8weaselab12VersionedMap8IteratordeEv
|
||||||
__ZNK8weaselab12VersionedMap8IteratoreqERKS1_
|
__ZNK8weaselab12VersionedMap8IteratoreqERKS1_
|
||||||
__ZNK8weaselab12VersionedMap8IteratorneERKS1_
|
__ZNK8weaselab12VersionedMap8IteratorneERKS1_
|
||||||
|
@@ -134,14 +134,6 @@ struct __attribute__((__visibility__("default"))) VersionedMap {
|
|||||||
bool operator==(const Iterator &) const;
|
bool operator==(const Iterator &) const;
|
||||||
bool operator!=(const Iterator &) const;
|
bool operator!=(const Iterator &) const;
|
||||||
|
|
||||||
/** 0 if this iterator's param1 is equal to the queried key, < 0 if this
|
|
||||||
* iterator's param1 is less than the queried key, and > 0 if this
|
|
||||||
* iterator's param1 is greater than the queried key. Iterating forward is
|
|
||||||
* treated as a query for the first mutation greater than this iterator's
|
|
||||||
* mutation, so will always result in a `cmp` > 0, and the converse for
|
|
||||||
* iterating backward (`cmp` < 0). */
|
|
||||||
int cmp() const;
|
|
||||||
|
|
||||||
/** @private */
|
/** @private */
|
||||||
struct Impl;
|
struct Impl;
|
||||||
|
|
||||||
|
@@ -23,7 +23,6 @@ _ZNK8weaselab12VersionedMap10getVersionEv
|
|||||||
_ZNK8weaselab12VersionedMap16getOldestVersionEv
|
_ZNK8weaselab12VersionedMap16getOldestVersionEv
|
||||||
_ZNK8weaselab12VersionedMap3endEl
|
_ZNK8weaselab12VersionedMap3endEl
|
||||||
_ZNK8weaselab12VersionedMap5beginEl
|
_ZNK8weaselab12VersionedMap5beginEl
|
||||||
_ZNK8weaselab12VersionedMap8Iterator3cmpEv
|
|
||||||
_ZNK8weaselab12VersionedMap8IteratordeEv
|
_ZNK8weaselab12VersionedMap8IteratordeEv
|
||||||
_ZNK8weaselab12VersionedMap8IteratoreqERKS1_
|
_ZNK8weaselab12VersionedMap8IteratoreqERKS1_
|
||||||
_ZNK8weaselab12VersionedMap8IteratorneERKS1_
|
_ZNK8weaselab12VersionedMap8IteratorneERKS1_
|
||||||
|
Reference in New Issue
Block a user