Interface change! addWrites now takes a single write version
All checks were successful
Tests / Release [gcc] total: 704, passed: 704
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend
|:-:|:-:|:-:|:-:|:-:
|0|0|0|0|:clap:
Reference build: <a href="https://jenkins.weaselab.dev/job/weaselab/job/conflict-set/job/main/57//gcc">weaselab » conflict-set » main #57</a>
Tests / Release [gcc,aarch64] total: 703, passed: 703
Tests / Coverage total: 702, passed: 702
weaselab/conflict-set/pipeline/head This commit looks good
All checks were successful
Tests / Release [gcc] total: 704, passed: 704
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend
|:-:|:-:|:-:|:-:|:-:
|0|0|0|0|:clap:
Reference build: <a href="https://jenkins.weaselab.dev/job/weaselab/job/conflict-set/job/main/57//gcc">weaselab » conflict-set » main #57</a>
Tests / Release [gcc,aarch64] total: 703, passed: 703
Tests / Coverage total: 702, passed: 702
weaselab/conflict-set/pipeline/head This commit looks good
This commit is contained in:
@@ -1847,18 +1847,18 @@ struct __attribute__((visibility("hidden"))) ConflictSet::Impl {
|
||||
}
|
||||
}
|
||||
|
||||
void addWrites(const WriteRange *writes, int count) {
|
||||
void addWrites(const WriteRange *writes, int count, int64_t writeVersion) {
|
||||
for (int i = 0; i < count; ++i) {
|
||||
const auto &w = writes[i];
|
||||
auto begin = std::span<const uint8_t>(w.begin.p, w.begin.len);
|
||||
auto end = std::span<const uint8_t>(w.end.p, w.end.len);
|
||||
if (w.end.len > 0) {
|
||||
keyUpdates += 3;
|
||||
addWriteRange(root, oldestVersion, begin, end, w.writeVersion,
|
||||
addWriteRange(root, oldestVersion, begin, end, writeVersion,
|
||||
&allocators, this);
|
||||
} else {
|
||||
keyUpdates += 2;
|
||||
addPointWrite(root, oldestVersion, begin, w.writeVersion, &allocators,
|
||||
addPointWrite(root, oldestVersion, begin, writeVersion, &allocators,
|
||||
this);
|
||||
}
|
||||
}
|
||||
@@ -1954,8 +1954,9 @@ void ConflictSet::check(const ReadRange *reads, Result *results,
|
||||
return impl->check(reads, results, count);
|
||||
}
|
||||
|
||||
void ConflictSet::addWrites(const WriteRange *writes, int count) {
|
||||
return impl->addWrites(writes, count);
|
||||
void ConflictSet::addWrites(const WriteRange *writes, int count,
|
||||
int64_t writeVersion) {
|
||||
return impl->addWrites(writes, count, writeVersion);
|
||||
}
|
||||
|
||||
void ConflictSet::setOldestVersion(int64_t oldestVersion) {
|
||||
@@ -2009,9 +2010,9 @@ ConflictSet_check(void *cs, const ConflictSet_ReadRange *reads,
|
||||
((ConflictSet::Impl *)cs)->check(reads, results, count);
|
||||
}
|
||||
__attribute__((__visibility__("default"))) void
|
||||
ConflictSet_addWrites(void *cs, const ConflictSet_WriteRange *writes,
|
||||
int count) {
|
||||
((ConflictSet::Impl *)cs)->addWrites(writes, count);
|
||||
ConflictSet_addWrites(void *cs, const ConflictSet_WriteRange *writes, int count,
|
||||
int64_t writeVersion) {
|
||||
((ConflictSet::Impl *)cs)->addWrites(writes, count, writeVersion);
|
||||
}
|
||||
__attribute__((__visibility__("default"))) void
|
||||
ConflictSet_setOldestVersion(void *cs, int64_t oldestVersion) {
|
||||
@@ -2239,29 +2240,19 @@ void printTree() {
|
||||
ConflictSet::Impl cs{writeVersion};
|
||||
ReferenceImpl refImpl{writeVersion};
|
||||
Arena arena;
|
||||
constexpr int kNumKeys = 4;
|
||||
auto *write = new (arena) ConflictSet::WriteRange[kNumKeys];
|
||||
write[0].begin = "and"_s;
|
||||
write[0].end = "ant"_s;
|
||||
write[0].writeVersion = 1;
|
||||
|
||||
write[1].begin = "any"_s;
|
||||
write[1].end.len = 0;
|
||||
write[1].writeVersion = 2;
|
||||
|
||||
write[2].begin = "are"_s;
|
||||
write[2].end.len = 0;
|
||||
write[2].writeVersion = 3;
|
||||
|
||||
write[3].begin = "art"_s;
|
||||
write[3].end.len = 0;
|
||||
write[3].writeVersion = 4;
|
||||
|
||||
cs.addWrites(write, kNumKeys);
|
||||
for (int i = 0; i < kNumKeys; ++i) {
|
||||
write[i].writeVersion = ++writeVersion;
|
||||
}
|
||||
cs.addWrites(write, kNumKeys);
|
||||
ConflictSet::WriteRange write;
|
||||
write.begin = "and"_s;
|
||||
write.end = "ant"_s;
|
||||
cs.addWrites(&write, 1, ++writeVersion);
|
||||
write.begin = "any"_s;
|
||||
write.end = ""_s;
|
||||
cs.addWrites(&write, 1, ++writeVersion);
|
||||
write.begin = "are"_s;
|
||||
write.end = ""_s;
|
||||
cs.addWrites(&write, 1, ++writeVersion);
|
||||
write.begin = "art"_s;
|
||||
write.end = ""_s;
|
||||
cs.addWrites(&write, 1, ++writeVersion);
|
||||
debugPrintDot(stdout, cs.root, &cs);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user