mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
Remove more unused structures from unit tests
The NFA, LBR no longer need scratch or the NFAContext structure stored outside the NFA stack.
This commit is contained in:
parent
c3860a9f29
commit
cf00094f24
@ -36,7 +36,6 @@
|
|||||||
#include "nfa/nfa_internal.h"
|
#include "nfa/nfa_internal.h"
|
||||||
#include "nfa/nfa_api_util.h"
|
#include "nfa/nfa_api_util.h"
|
||||||
#include "nfagraph/ng_lbr.h"
|
#include "nfagraph/ng_lbr.h"
|
||||||
#include "scratch.h"
|
|
||||||
#include "util/alloc.h"
|
#include "util/alloc.h"
|
||||||
#include "util/compile_context.h"
|
#include "util/compile_context.h"
|
||||||
#include "grey.h"
|
#include "grey.h"
|
||||||
@ -155,9 +154,6 @@ protected:
|
|||||||
// Space for stream state.
|
// Space for stream state.
|
||||||
aligned_unique_ptr<char> stream_state;
|
aligned_unique_ptr<char> stream_state;
|
||||||
|
|
||||||
// Space for NFAContext structure.
|
|
||||||
aligned_unique_ptr<void> nfa_context;
|
|
||||||
|
|
||||||
// Queue structure.
|
// Queue structure.
|
||||||
struct mq q;
|
struct mq q;
|
||||||
};
|
};
|
||||||
|
@ -39,7 +39,6 @@
|
|||||||
#include "nfa/nfa_api.h"
|
#include "nfa/nfa_api.h"
|
||||||
#include "nfa/nfa_api_util.h"
|
#include "nfa/nfa_api_util.h"
|
||||||
#include "nfa/nfa_internal.h"
|
#include "nfa/nfa_internal.h"
|
||||||
#include "scratch.h"
|
|
||||||
#include "util/alloc.h"
|
#include "util/alloc.h"
|
||||||
#include "util/target_info.h"
|
#include "util/target_info.h"
|
||||||
|
|
||||||
@ -86,11 +85,6 @@ protected:
|
|||||||
|
|
||||||
full_state = aligned_zmalloc_unique<char>(nfa->scratchStateSize);
|
full_state = aligned_zmalloc_unique<char>(nfa->scratchStateSize);
|
||||||
stream_state = aligned_zmalloc_unique<char>(nfa->streamStateSize);
|
stream_state = aligned_zmalloc_unique<char>(nfa->streamStateSize);
|
||||||
nfa_context = aligned_zmalloc_unique<void>(sizeof(NFAContext512));
|
|
||||||
|
|
||||||
// Mock up a scratch structure that contains the pieces that we need
|
|
||||||
// for NFA execution.
|
|
||||||
scratch = aligned_zmalloc_unique<hs_scratch>(sizeof(struct hs_scratch));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void initQueue() {
|
virtual void initQueue() {
|
||||||
@ -125,12 +119,6 @@ protected:
|
|||||||
// Space for stream state.
|
// Space for stream state.
|
||||||
aligned_unique_ptr<char> stream_state;
|
aligned_unique_ptr<char> stream_state;
|
||||||
|
|
||||||
// Space for NFAContext structure.
|
|
||||||
aligned_unique_ptr<void> nfa_context;
|
|
||||||
|
|
||||||
// Mock scratch.
|
|
||||||
aligned_unique_ptr<hs_scratch> scratch;
|
|
||||||
|
|
||||||
// Queue structure.
|
// Queue structure.
|
||||||
struct mq q;
|
struct mq q;
|
||||||
};
|
};
|
||||||
@ -331,12 +319,6 @@ protected:
|
|||||||
|
|
||||||
nfa = constructReversedNFA(g_rev, type, cc);
|
nfa = constructReversedNFA(g_rev, type, cc);
|
||||||
ASSERT_TRUE(nfa != nullptr);
|
ASSERT_TRUE(nfa != nullptr);
|
||||||
|
|
||||||
nfa_context = aligned_zmalloc_unique<void>(sizeof(NFAContext512));
|
|
||||||
|
|
||||||
// Mock up a scratch structure that contains the pieces that we need
|
|
||||||
// for reverse NFA execution.
|
|
||||||
scratch = aligned_zmalloc_unique<hs_scratch>(sizeof(struct hs_scratch));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NFA type (enum NFAEngineType)
|
// NFA type (enum NFAEngineType)
|
||||||
@ -347,12 +329,6 @@ protected:
|
|||||||
|
|
||||||
// Compiled NFA structure.
|
// Compiled NFA structure.
|
||||||
aligned_unique_ptr<NFA> nfa;
|
aligned_unique_ptr<NFA> nfa;
|
||||||
|
|
||||||
// Space for NFAContext structure.
|
|
||||||
aligned_unique_ptr<void> nfa_context;
|
|
||||||
|
|
||||||
// Mock scratch.
|
|
||||||
aligned_unique_ptr<hs_scratch> scratch;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(LimExReverse, LimExReverseTest,
|
INSTANTIATE_TEST_CASE_P(LimExReverse, LimExReverseTest,
|
||||||
@ -401,11 +377,6 @@ protected:
|
|||||||
|
|
||||||
full_state = aligned_zmalloc_unique<char>(nfa->scratchStateSize);
|
full_state = aligned_zmalloc_unique<char>(nfa->scratchStateSize);
|
||||||
stream_state = aligned_zmalloc_unique<char>(nfa->streamStateSize);
|
stream_state = aligned_zmalloc_unique<char>(nfa->streamStateSize);
|
||||||
nfa_context = aligned_zmalloc_unique<void>(sizeof(NFAContext512));
|
|
||||||
|
|
||||||
// Mock up a scratch structure that contains the pieces that we need
|
|
||||||
// for NFA execution.
|
|
||||||
scratch = aligned_zmalloc_unique<hs_scratch>(sizeof(struct hs_scratch));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void initQueue() {
|
virtual void initQueue() {
|
||||||
@ -440,12 +411,6 @@ protected:
|
|||||||
// Space for stream state.
|
// Space for stream state.
|
||||||
aligned_unique_ptr<char> stream_state;
|
aligned_unique_ptr<char> stream_state;
|
||||||
|
|
||||||
// Space for NFAContext structure.
|
|
||||||
aligned_unique_ptr<void> nfa_context;
|
|
||||||
|
|
||||||
// Mock scratch.
|
|
||||||
aligned_unique_ptr<hs_scratch> scratch;
|
|
||||||
|
|
||||||
// Queue structure.
|
// Queue structure.
|
||||||
struct mq q;
|
struct mq q;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user