childMaxVersion memory needs to be defined
All checks were successful
Tests / 64 bit versions total: 8220, passed: 8220
Tests / Debug total: 8218, passed: 8218
Tests / SIMD fallback total: 8220, passed: 8220
Tests / Release [clang] total: 8220, passed: 8220
Clang |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / gcc total: 8220, passed: 8220
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [clang,aarch64] total: 5446, passed: 5446
Tests / Coverage total: 5497, passed: 5497
Code Coverage #### Project Overview No changes detected, that affect the code coverage. * Line Coverage: 97.73% (3061/3132) * Branch Coverage: 41.68% (17736/42552) * Complexity Density: 0.00 * Lines of Code: 3132 #### Quality Gates Summary Output truncated.
weaselab/conflict-set/pipeline/head This commit looks good

Also remove some dead code, and only memset children to 0 for Node256.
Other nodes detect absence of children other ways.
This commit is contained in:
2024-11-21 10:35:05 -08:00
parent 8190d2f24e
commit 2412684316

View File

@@ -692,16 +692,6 @@ static_assert(kBytesPerKey - sizeof(Node0) >= kMinNodeSurplus);
// Which should give us the budget to pay for the key bytes. (children +
// entryPresent) is a lower bound on how many keys these bytes are a prefix of
constexpr int getMaxCapacity(int numChildren, int entryPresent,
int partialKeyLen) {
return (numChildren + entryPresent) * (partialKeyLen + 1);
}
constexpr int getMaxCapacity(Node *self) {
return getMaxCapacity(self->numChildren, self->entryPresent,
self->partialKeyLen);
}
template <class T> struct NodeAllocator {
static_assert(std::derived_from<T, Node>);
@@ -712,12 +702,14 @@ template <class T> struct NodeAllocator {
result->endOfRange = false;
result->releaseDeferred = false;
if constexpr (!std::is_same_v<T, Node0>) {
memset(result->children, 0, sizeof(result->children));
const auto z = InternalVersionT::zero;
for (auto &v : result->childMaxVersion) {
v = z;
}
}
if constexpr (std::is_same_v<T, Node256>) {
memset(result->children, 0, sizeof(result->children));
}
if constexpr (std::is_same_v<T, Node48> || std::is_same_v<T, Node256>) {
const auto z = InternalVersionT::zero;
for (auto &v : result->maxOfMax) {
@@ -1973,8 +1965,6 @@ Node *erase(Node *self, WriteContext *writeContext, ConflictSet::Impl *impl,
sizeof(parent3->index[0]));
VALGRIND_MAKE_MEM_UNDEFINED(parent3->children + parent3->numChildren,
sizeof(parent3->children[0]));
VALGRIND_MAKE_MEM_UNDEFINED(parent3->childMaxVersion + parent3->numChildren,
sizeof(parent3->childMaxVersion[0]));
if (needsDownsize(parent3)) {
downsize(parent3, writeContext, impl);
@@ -1994,9 +1984,6 @@ Node *erase(Node *self, WriteContext *writeContext, ConflictSet::Impl *impl,
sizeof(parent16->index[0]));
VALGRIND_MAKE_MEM_UNDEFINED(parent16->children + parent16->numChildren,
sizeof(parent16->children[0]));
VALGRIND_MAKE_MEM_UNDEFINED(parent16->childMaxVersion +
parent16->numChildren,
sizeof(parent16->childMaxVersion[0]));
if (needsDownsize(parent16)) {
downsize(parent16, writeContext, impl);