Group read only queries together
This commit is contained in:
@@ -1369,6 +1369,48 @@ bool checkRangeVersionOfFirstGeq(Node *node, InternalVersionT readVersion) {
|
|||||||
return node->entry.rangeVersion <= readVersion;
|
return node->entry.rangeVersion <= readVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Node *nextPhysical(Node *node) {
|
||||||
|
Node *nextChild = getFirstChild(node);
|
||||||
|
if (nextChild != nullptr) {
|
||||||
|
return nextChild;
|
||||||
|
}
|
||||||
|
for (;;) {
|
||||||
|
int index = node->parentsIndex;
|
||||||
|
node = node->parent;
|
||||||
|
if (node == nullptr) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
Node *nextChild = getChildGeq(node, index + 1);
|
||||||
|
if (nextChild != nullptr) {
|
||||||
|
return nextChild;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Node *nextLogical(Node *node) {
|
||||||
|
Node *nextChild = getFirstChild(node);
|
||||||
|
if (nextChild != nullptr) {
|
||||||
|
node = nextChild;
|
||||||
|
goto downLeftSpine;
|
||||||
|
}
|
||||||
|
for (;;) {
|
||||||
|
int index = node->parentsIndex;
|
||||||
|
node = node->parent;
|
||||||
|
if (node == nullptr) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
Node *nextChild = getChildGeq(node, index + 1);
|
||||||
|
if (nextChild != nullptr) {
|
||||||
|
node = nextChild;
|
||||||
|
goto downLeftSpine;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
downLeftSpine:
|
||||||
|
for (; !node->entryPresent; node = getFirstChild(node)) {
|
||||||
|
}
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
|
||||||
// self must not be the root
|
// self must not be the root
|
||||||
void maybeDecreaseCapacity(Node *&self, WriteContext *writeContext);
|
void maybeDecreaseCapacity(Node *&self, WriteContext *writeContext);
|
||||||
|
|
||||||
@@ -1613,48 +1655,6 @@ TaggedNodePointer &getOrCreateChild(TaggedNodePointer &self, TrivialSpan &key,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Node *nextPhysical(Node *node) {
|
|
||||||
Node *nextChild = getFirstChild(node);
|
|
||||||
if (nextChild != nullptr) {
|
|
||||||
return nextChild;
|
|
||||||
}
|
|
||||||
for (;;) {
|
|
||||||
int index = node->parentsIndex;
|
|
||||||
node = node->parent;
|
|
||||||
if (node == nullptr) {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
Node *nextChild = getChildGeq(node, index + 1);
|
|
||||||
if (nextChild != nullptr) {
|
|
||||||
return nextChild;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Node *nextLogical(Node *node) {
|
|
||||||
Node *nextChild = getFirstChild(node);
|
|
||||||
if (nextChild != nullptr) {
|
|
||||||
node = nextChild;
|
|
||||||
goto downLeftSpine;
|
|
||||||
}
|
|
||||||
for (;;) {
|
|
||||||
int index = node->parentsIndex;
|
|
||||||
node = node->parent;
|
|
||||||
if (node == nullptr) {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
Node *nextChild = getChildGeq(node, index + 1);
|
|
||||||
if (nextChild != nullptr) {
|
|
||||||
node = nextChild;
|
|
||||||
goto downLeftSpine;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
downLeftSpine:
|
|
||||||
for (; !node->entryPresent; node = getFirstChild(node)) {
|
|
||||||
}
|
|
||||||
return node;
|
|
||||||
}
|
|
||||||
|
|
||||||
void freeAndMakeCapacity(Node *&self, int capacity,
|
void freeAndMakeCapacity(Node *&self, int capacity,
|
||||||
WriteContext *writeContext) {
|
WriteContext *writeContext) {
|
||||||
++writeContext->accum.nodes_resized;
|
++writeContext->accum.nodes_resized;
|
||||||
|
Reference in New Issue
Block a user