mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
tools: fix compile issue for RELEASE_BUILD code
Fixes github issue #186
This commit is contained in:
parent
52e19cb61c
commit
e811a8dbb8
@ -414,6 +414,7 @@ buildEngineHyperscan(const ExpressionMap &expressions, ScanMode scan_mode,
|
||||
hs_compile_error_t *compile_err;
|
||||
Timer timer;
|
||||
|
||||
#ifndef RELEASE_BUILD
|
||||
if (useLiteralApi) {
|
||||
// Pattern length computation should be done before timer start.
|
||||
vector<size_t> lens(count);
|
||||
@ -434,6 +435,26 @@ buildEngineHyperscan(const ExpressionMap &expressions, ScanMode scan_mode,
|
||||
grey);
|
||||
timer.complete();
|
||||
}
|
||||
#else
|
||||
if (useLiteralApi) {
|
||||
// Pattern length computation should be done before timer start.
|
||||
vector<size_t> lens(count);
|
||||
for (unsigned int i = 0; i < count; i++) {
|
||||
lens[i] = strlen(patterns[i]);
|
||||
}
|
||||
timer.start();
|
||||
err = hs_compile_lit_multi(patterns.data(), flags.data(),
|
||||
ids.data(), lens.data(), count,
|
||||
full_mode, nullptr, &db, &compile_err);
|
||||
timer.complete();
|
||||
} else {
|
||||
timer.start();
|
||||
err = hs_compile_ext_multi(patterns.data(), flags.data(),
|
||||
ids.data(), ext_ptr.data(), count,
|
||||
full_mode, nullptr, &db, &compile_err);
|
||||
timer.complete();
|
||||
}
|
||||
#endif
|
||||
|
||||
compileSecs = timer.seconds();
|
||||
peakMemorySize = getPeakHeap();
|
||||
|
@ -336,9 +336,8 @@ void checkExpression(UNUSED void *threadarg) {
|
||||
#else
|
||||
if (use_literal_api) {
|
||||
size_t len = strlen(regexp);
|
||||
err = hs_compile_lit_multi_int(®exp, &flags, nullptr, &extp,
|
||||
&len, 1, mode, nullptr, &db,
|
||||
&compile_err, *g_grey);
|
||||
err = hs_compile_lit_multi(®exp, &flags, nullptr, &len, 1,
|
||||
mode, nullptr, &db, &compile_err);
|
||||
} else {
|
||||
err = hs_compile_ext_multi(®exp, &flags, nullptr, &extp, 1,
|
||||
mode, nullptr, &db, &compile_err);
|
||||
|
Loading…
x
Reference in New Issue
Block a user