Remove interleaved_insert::begin
This commit is contained in:
@@ -4127,29 +4127,6 @@ template <class NodeT> PRESERVE_NONE void iter(Job *, Context *);
|
||||
static Continuation iterTable[] = {iter<Node0>, iter<Node3>, iter<Node16>,
|
||||
iter<Node48>, iter<Node256>};
|
||||
|
||||
PRESERVE_NONE void begin(Job *job, Context *context) {
|
||||
if (job->remaining.size() == 0) [[unlikely]] {
|
||||
context->results[job->index] = {job->n, job->remaining};
|
||||
MUSTTAIL return complete(job, context);
|
||||
}
|
||||
|
||||
TaggedNodePointer *child =
|
||||
getChildUpdatingMaxVersion(job->n, job->remaining, context->writeVersion);
|
||||
|
||||
if (child == nullptr) [[unlikely]] {
|
||||
context->results[job->index] = {job->n, job->remaining};
|
||||
MUSTTAIL return complete(job, context);
|
||||
}
|
||||
job->n = *child;
|
||||
if (job->remaining.size() == 0) [[unlikely]] {
|
||||
context->results[job->index] = {job->n, job->remaining};
|
||||
MUSTTAIL return complete(job, context);
|
||||
}
|
||||
job->continuation = iterTable[child->getType()];
|
||||
__builtin_prefetch(job->n);
|
||||
MUSTTAIL return keepGoing(job, context);
|
||||
}
|
||||
|
||||
template <class NodeT> void iter(Job *job, Context *context) {
|
||||
assert(NodeT::kType == job->n->getType());
|
||||
NodeT *n = static_cast<NodeT *>(job->n);
|
||||
@@ -4172,10 +4149,16 @@ template <class NodeT> void iter(Job *job, Context *context) {
|
||||
|
||||
void Job::init(Context *context, int index) {
|
||||
this->index = index;
|
||||
this->continuation = interleaved_insert::begin;
|
||||
this->remaining = std::span<const uint8_t>(context->writes[index].begin.p,
|
||||
context->writes[index].begin.len);
|
||||
this->n = context->root;
|
||||
remaining = std::span<const uint8_t>(context->writes[index].begin.p,
|
||||
context->writes[index].begin.len);
|
||||
n = context->root;
|
||||
|
||||
if (remaining.size() == 0) [[unlikely]] {
|
||||
context->results[index] = {n, remaining};
|
||||
continuation = interleaved_insert::complete;
|
||||
} else {
|
||||
continuation = iterTable[n->getType()];
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace interleaved_insert
|
||||
|
Reference in New Issue
Block a user