Compare commits
4 Commits
639518bed4
...
5378a06c39
| Author | SHA1 | Date | |
|---|---|---|---|
| 5378a06c39 | |||
| 12c6ed2568 | |||
| a2bf839b19 | |||
| c065b185ae |
+54
-22
@@ -313,7 +313,7 @@ struct Node256 : Node {
|
|||||||
BitSet bitSet;
|
BitSet bitSet;
|
||||||
Node *children[256];
|
Node *children[256];
|
||||||
int64_t childMaxVersion[256];
|
int64_t childMaxVersion[256];
|
||||||
constexpr static int kMaxOfMaxPageSize = 8;
|
constexpr static int kMaxOfMaxPageSize = 16;
|
||||||
constexpr static int kMaxOfMaxShift =
|
constexpr static int kMaxOfMaxShift =
|
||||||
std::countr_zero(uint32_t(kMaxOfMaxPageSize));
|
std::countr_zero(uint32_t(kMaxOfMaxPageSize));
|
||||||
constexpr static int kMaxOfMaxTotalPages = 256 / kMaxOfMaxPageSize;
|
constexpr static int kMaxOfMaxTotalPages = 256 / kMaxOfMaxPageSize;
|
||||||
@@ -1779,6 +1779,7 @@ bool checkMaxBetweenExclusive(Node *n, int begin, int end,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// [begin, end) is now the half-open interval of children we're interested in.
|
// [begin, end) is now the half-open interval of children we're interested in.
|
||||||
|
assert(begin < end);
|
||||||
|
|
||||||
const unsigned shiftUpperBound = end - begin;
|
const unsigned shiftUpperBound = end - begin;
|
||||||
const unsigned shiftAmount = begin;
|
const unsigned shiftAmount = begin;
|
||||||
@@ -1820,36 +1821,67 @@ bool checkMaxBetweenExclusive(Node *n, int begin, int end,
|
|||||||
}
|
}
|
||||||
case Type_Node256: {
|
case Type_Node256: {
|
||||||
auto *self = static_cast<Node256 *>(n);
|
auto *self = static_cast<Node256 *>(n);
|
||||||
// Check the first page
|
if (end <= 0) {
|
||||||
if (self->maxOfMax[begin >> Node256::kMaxOfMaxShift] > readVersion) {
|
return true;
|
||||||
bool result = true;
|
|
||||||
for (int i = 0; i < Node256::kMaxOfMaxPageSize; ++i) {
|
|
||||||
int j = (begin & ~(Node256::kMaxOfMaxPageSize - 1)) + i;
|
|
||||||
result &= !((self->childMaxVersion[j] > readVersion) & inBounds(j));
|
|
||||||
}
|
}
|
||||||
if (!result) {
|
const int firstPage = begin >> Node256::kMaxOfMaxShift;
|
||||||
return result;
|
const int lastPage = (end - 1) >> Node256::kMaxOfMaxShift;
|
||||||
|
if (firstPage == lastPage) {
|
||||||
|
if (self->maxOfMax[firstPage] <= readVersion) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
uint64_t conflict = 0;
|
||||||
|
// Check all in page
|
||||||
|
for (int i = 0; i < Node256::kMaxOfMaxPageSize; ++i) {
|
||||||
|
conflict |=
|
||||||
|
(self->childMaxVersion[(firstPage << Node256::kMaxOfMaxShift) + i] >
|
||||||
|
readVersion)
|
||||||
|
<< i;
|
||||||
|
}
|
||||||
|
// Mask away out of bounds
|
||||||
|
const int intraPageBegin = begin & (Node256::kMaxOfMaxPageSize - 1);
|
||||||
|
const int intraPageEnd = end - (lastPage << Node256::kMaxOfMaxShift);
|
||||||
|
conflict &= (1 << intraPageEnd) - 1;
|
||||||
|
conflict >>= intraPageBegin;
|
||||||
|
return !conflict;
|
||||||
|
}
|
||||||
|
// Check the first page
|
||||||
|
if (self->maxOfMax[firstPage] > readVersion) {
|
||||||
|
uint64_t conflict = 0;
|
||||||
|
for (int i = 0; i < Node256::kMaxOfMaxPageSize; ++i) {
|
||||||
|
int j = (firstPage << Node256::kMaxOfMaxShift) + i;
|
||||||
|
conflict |= (self->childMaxVersion[j] > readVersion) << i;
|
||||||
|
}
|
||||||
|
const int intraPageBegin = begin & (Node256::kMaxOfMaxPageSize - 1);
|
||||||
|
conflict >>= intraPageBegin;
|
||||||
|
if (conflict) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Check the last page
|
// Check the last page
|
||||||
if (end >= 1 &&
|
if (self->maxOfMax[lastPage] > readVersion) {
|
||||||
self->maxOfMax[(end - 1) >> Node256::kMaxOfMaxShift] > readVersion) {
|
uint64_t conflict = 0;
|
||||||
bool result = true;
|
|
||||||
for (int i = 0; i < Node256::kMaxOfMaxPageSize; ++i) {
|
for (int i = 0; i < Node256::kMaxOfMaxPageSize; ++i) {
|
||||||
int j = ((end - 1) & ~(Node256::kMaxOfMaxPageSize - 1)) + i;
|
int j = (lastPage << Node256::kMaxOfMaxShift) + i;
|
||||||
result &= !((self->childMaxVersion[j] > readVersion) & inBounds(j));
|
conflict |= (self->childMaxVersion[j] > readVersion) << i;
|
||||||
}
|
}
|
||||||
if (!result) {
|
const int intraPageEnd = end - (lastPage << Node256::kMaxOfMaxShift);
|
||||||
return result;
|
conflict &= (1 << intraPageEnd) - 1;
|
||||||
|
if (conflict) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Check inner pages
|
uint64_t conflict = 0;
|
||||||
bool result = true;
|
// Check all possible inner pages
|
||||||
for (int i = (begin >> Node256::kMaxOfMaxShift) + 1;
|
for (int i = 1; i < Node256::kMaxOfMaxTotalPages - 1; ++i) {
|
||||||
i < ((end - 1) >> Node256::kMaxOfMaxShift); ++i) {
|
conflict |= (self->maxOfMax[i] > readVersion) << i;
|
||||||
result &= self->maxOfMax[i] <= readVersion;
|
|
||||||
}
|
}
|
||||||
return result;
|
// Only keep inner pages
|
||||||
|
const int innerPageBegin = (begin >> Node256::kMaxOfMaxShift) + 1;
|
||||||
|
const int innerPageEnd = (end - 1) >> Node256::kMaxOfMaxShift;
|
||||||
|
conflict &= (1 << innerPageEnd) - 1;
|
||||||
|
conflict >>= innerPageBegin;
|
||||||
|
return !conflict;
|
||||||
}
|
}
|
||||||
default: // GCOVR_EXCL_LINE
|
default: // GCOVR_EXCL_LINE
|
||||||
__builtin_unreachable(); // GCOVR_EXCL_LINE
|
__builtin_unreachable(); // GCOVR_EXCL_LINE
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 11 B |
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 1.6 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 2.5 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user