Don't poison Node48 reverseIndex
Follows the reasoning of "Remove redundant version update": a write can never lower the logical max version of a key range, so there's no read that didn't pass before that should pass after a write. The check stays exact reading the physical childMaxVersion and reverseIndex of unused slots, so scan16's whole-page reads of them are well-defined and intended. The client requests only produced valgrind false positives. Keep the initialization, drop the poisoning.
This commit is contained in:
1 parent
9c721bcdca
commit
8621662d3c
1 file changed
+2
-12
+2
-12
@@ -571,11 +571,7 @@ inline void Node48::copyChildrenAndKeyFrom(const Node16 &other) {
|
||||
}
|
||||
// The reverseIndex bytes beyond numChildren are initialized so that the
|
||||
// SIMD loads of a full 16-byte page in scan16 are well-defined (reading
|
||||
// indeterminate bytes is UB in C++). valgrind then treats them as undefined
|
||||
// so that it can still flag any read that relies on them.
|
||||
VALGRIND_MAKE_MEM_UNDEFINED(reverseIndex + numChildren,
|
||||
sizeof(reverseIndex) -
|
||||
numChildren * sizeof(reverseIndex[0]));
|
||||
// indeterminate bytes is UB in C++).
|
||||
}
|
||||
|
||||
inline void Node48::copyChildrenAndKeyFrom(const Node48 &other) {
|
||||
@@ -626,11 +622,7 @@ inline void Node48::copyChildrenAndKeyFrom(const Node256 &other) {
|
||||
memcpy(partialKey(), &other + 1, partialKeyLen);
|
||||
// The reverseIndex bytes beyond numChildren are initialized so that the
|
||||
// SIMD loads of a full 16-byte page in scan16 are well-defined (reading
|
||||
// indeterminate bytes is UB in C++). valgrind then treats them as undefined
|
||||
// so that it can still flag any read that relies on them.
|
||||
VALGRIND_MAKE_MEM_UNDEFINED(reverseIndex + numChildren,
|
||||
sizeof(reverseIndex) -
|
||||
numChildren * sizeof(reverseIndex[0]));
|
||||
// indeterminate bytes is UB in C++).
|
||||
}
|
||||
|
||||
inline void Node256::copyChildrenAndKeyFrom(const Node48 &other) {
|
||||
@@ -2024,8 +2016,6 @@ Node *erase(Node *self, WriteContext *writeContext, bool logical) {
|
||||
}
|
||||
VALGRIND_MAKE_MEM_UNDEFINED(parent48->children + lastChildrenIndex,
|
||||
sizeof(parent48->children[0]));
|
||||
VALGRIND_MAKE_MEM_UNDEFINED(parent48->reverseIndex + lastChildrenIndex,
|
||||
sizeof(parent48->reverseIndex[0]));
|
||||
|
||||
if (needsDownsize(parent48)) {
|
||||
downsize(parent48, writeContext);
|
||||
|
||||
Reference in new issue
Block a user