2 Commits

Author SHA1 Message Date
587874841f Fix test that had a decreasing write version
Some checks failed
Tests / Clang total: 1039, passed: 1039
Clang |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / SIMD fallback total: 1039, passed: 1039
Tests / 32-bit versions total: 1039, passed: 1039
weaselab/conflict-set/pipeline/head There was a failure building this commit
2024-06-28 19:57:25 -07:00
648b0b9238 Add an always_inline, with explanatory comment 2024-06-28 19:55:33 -07:00
2 changed files with 6 additions and 3 deletions

View File

@@ -1848,8 +1848,11 @@ bool scan16(const InternalVersionT *vs, const uint8_t *is, int begin, int end,
} }
// Returns true if v[i] <= readVersion for all i such that begin <= i < end // Returns true if v[i] <= readVersion for all i such that begin <= i < end
bool scan16(const InternalVersionT *vs, int begin, int end, //
InternalVersionT readVersion) { // always_inline So that we can optimize when begin or end is a constant.
__attribute((always_inline)) bool scan16(const InternalVersionT *vs, int begin,
int end,
InternalVersionT readVersion) {
assert(0 <= begin && begin < 16); assert(0 <= begin && begin < 16);
assert(0 <= end && end <= 16); assert(0 <= end && end <= 16);
assert(begin <= end); assert(begin <= end);

View File

@@ -73,7 +73,7 @@ def test_internal_version_zero():
cs.addWrites(0xFFFFFFF1, write(bytes([i]))) cs.addWrites(0xFFFFFFF1, write(bytes([i])))
for i in range(256 - 25, 256): for i in range(256 - 25, 256):
cs.addWrites(0xFFFFFFF1, write(bytes([i]))) cs.addWrites(0xFFFFFFF1, write(bytes([i])))
cs.addWrites(0, write(b"\xff")) cs.addWrites(0x100000000, write(b"\xff"))
cs.check(read(0xFFFFFFF1, b"\x00", b"\xff")) cs.check(read(0xFFFFFFF1, b"\x00", b"\xff"))