From 8f3471dd4e10f5b5fd8e868bc13d5d2d6dfc008b Mon Sep 17 00:00:00 2001 From: Justin Viiret Date: Thu, 11 Feb 2016 14:38:12 +1100 Subject: [PATCH] Rename reduceQueue to reduceInfixQueue --- src/rose/infix.h | 5 +++-- src/rose/program_runtime.h | 6 +++--- src/rose/stream.c | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/rose/infix.h b/src/rose/infix.h index 785d6354..0cc63fdf 100644 --- a/src/rose/infix.h +++ b/src/rose/infix.h @@ -1,5 +1,5 @@ /* - * 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: @@ -63,12 +63,13 @@ int infixTooOld(struct mq *q, s64a curr_loc) { * 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; diff --git a/src/rose/program_runtime.h b/src/rose/program_runtime.h index a8734cb7..075f0fc6 100644 --- a/src/rose/program_runtime.h +++ b/src/rose/program_runtime.h @@ -442,7 +442,7 @@ char roseTestLeftfix(const struct RoseEngine *t, struct hs_scratch *scratch, 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)) { @@ -540,10 +540,10 @@ void roseTriggerInfix(const struct RoseEngine *t, struct hs_scratch *scratch, 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); diff --git a/src/rose/stream.c b/src/rose/stream.c index bd302145..161e0059 100644 --- a/src/rose/stream.c +++ b/src/rose/stream.c @@ -291,7 +291,7 @@ char roseCatchUpLeftfix(const struct RoseEngine *t, char *state, 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);