exhaust: move functions to report.h

This commit is contained in:
Justin Viiret
2016-05-26 14:21:40 +10:00
committed by Matthew Barr
parent 9b7eca5400
commit 6e49544558
4 changed files with 69 additions and 72 deletions

View File

@@ -35,7 +35,6 @@
#include "rose_internal.h"
#include "scratch.h"
#include "util/exhaust.h" // for isExhausted
#include "util/partial_store.h"
/*
@@ -108,39 +107,6 @@ const u8 *getLeftfixLagTableConst(const struct RoseEngine *t,
return (const u8 *)(state + t->stateOffsets.leftfixLagTable);
}
static rose_inline
char roseSuffixInfoIsExhausted(const struct RoseEngine *t,
const struct NfaInfo *info,
const char *exhausted) {
if (!info->ekeyListOffset) {
return 0;
}
DEBUG_PRINTF("check exhaustion -> start at %u\n", info->ekeyListOffset);
/* INVALID_EKEY terminated list */
const u32 *ekeys = (const u32 *)((const char *)t + info->ekeyListOffset);
while (*ekeys != INVALID_EKEY) {
DEBUG_PRINTF("check %u\n", *ekeys);
if (!isExhausted(t, exhausted, *ekeys)) {
DEBUG_PRINTF("not exhausted -> alive\n");
return 0;
}
++ekeys;
}
DEBUG_PRINTF("all ekeys exhausted -> dead\n");
return 1;
}
static really_inline
char roseSuffixIsExhausted(const struct RoseEngine *t, u32 qi,
const char *exhausted) {
DEBUG_PRINTF("check queue %u\n", qi);
const struct NfaInfo *info = getNfaInfoByQueue(t, qi);
return roseSuffixInfoIsExhausted(t, info, exhausted);
}
static really_inline
u32 has_chained_nfas(const struct RoseEngine *t) {
return t->outfixBeginQueue;