/*
- * Copyright (c) 2015, Intel Corporation
+ * Copyright (c) 2015-2016, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* engine.
*/
static really_inline
-void reduceQueue(struct mq *q, s64a curr_loc, u32 maxTops, u32 maxAge) {
+void reduceInfixQueue(struct mq *q, s64a curr_loc, u32 maxTops, u32 maxAge) {
assert(q->end > q->cur);
assert(maxTops);
u32 qlen = q->end - q->cur; /* includes MQE_START */
DEBUG_PRINTF("q=%p, len=%u, maxTops=%u maxAge=%u\n", q, qlen, maxTops,
maxAge);
+
char any_work = 0;
if (maxAge && q->items[q->cur].location + maxAge < curr_loc) {
any_work = 1;
goto nfa_dead;
}
- reduceQueue(q, loc, left->maxQueueLen, q->nfa->maxWidth);
+ reduceInfixQueue(q, loc, left->maxQueueLen, q->nfa->maxWidth);
}
if (!rosePrefixCheckMiracles(t, left, ci, q, end)) {
pushQueueAt(q, 0, MQE_START, loc);
nfaQueueInitState(q->nfa, q);
} else if (isQueueFull(q)) {
- reduceQueue(q, loc, left->maxQueueLen, q->nfa->maxWidth);
+ reduceInfixQueue(q, loc, left->maxQueueLen, q->nfa->maxWidth);
if (isQueueFull(q)) {
- /* still full - reduceQueue did nothing */
+ /* still full - reduceInfixQueue did nothing */
DEBUG_PRINTF("queue %u full (%u items) -> catching up nfa\n", qi,
q->end - q->cur);
pushQueueNoMerge(q, MQE_END, loc);
DEBUG_PRINTF("infix died of old age\n");
return 0;
}
- reduceQueue(q, last_loc, left->maxQueueLen, q->nfa->maxWidth);
+ reduceInfixQueue(q, last_loc, left->maxQueueLen, q->nfa->maxWidth);
}
DEBUG_PRINTF("end scan at %lld\n", last_loc);