mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-09-29 19:24:25 +03:00
Rose: use a multibit for the exhaustion vector
Previously, the exhaustion vector was a standard bitvector, which required an expensive memset() call at init for databases with a large number of exhaustion keys.
This commit is contained in:
committed by
Matthew Barr
parent
1fcd3cfb2c
commit
f2c0a66b6f
@@ -1146,7 +1146,7 @@ hwlmcb_rv_t roseRunProgram(const struct RoseEngine *t,
|
||||
assert(ri->ekey != INVALID_EKEY);
|
||||
assert(ri->ekey < t->ekeyCount);
|
||||
const char *evec = scratch->core_info.exhaustionVector;
|
||||
if (isExhausted(evec, ri->ekey)) {
|
||||
if (isExhausted(t, evec, ri->ekey)) {
|
||||
DEBUG_PRINTF("ekey %u already set, match is exhausted\n",
|
||||
ri->ekey);
|
||||
assert(ri->fail_jump); // must progress
|
||||
|
@@ -666,9 +666,9 @@ void fillStateOffsets(const RoseBuildImpl &tbi, u32 rolesWithStateCount,
|
||||
so->history = curr_offset;
|
||||
curr_offset += historyRequired;
|
||||
|
||||
// Exhausted bit vector.
|
||||
// Exhaustion multibit.
|
||||
so->exhausted = curr_offset;
|
||||
curr_offset += ROUNDUP_N(tbi.rm.numEkeys(), 8) / 8;
|
||||
curr_offset += mmbit_size(tbi.rm.numEkeys());
|
||||
|
||||
// SOM locations and valid/writeable multibit structures.
|
||||
if (tbi.ssm.numSomSlots()) {
|
||||
|
@@ -123,7 +123,7 @@ char roseSuffixInfoIsExhausted(const struct RoseEngine *t,
|
||||
const u32 *ekeys = (const u32 *)((const char *)t + info->ekeyListOffset);
|
||||
while (*ekeys != END_EXHAUST) {
|
||||
DEBUG_PRINTF("check %u\n", *ekeys);
|
||||
if (!isExhausted(exhausted, *ekeys)) {
|
||||
if (!isExhausted(t, exhausted, *ekeys)) {
|
||||
DEBUG_PRINTF("not exhausted -> alive\n");
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user