mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-09-29 19:24:25 +03:00
tools: fix compile issue for RELEASE_BUILD code
Fixes github issue #186
This commit is contained in:
@@ -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();
|
||||
|
Reference in New Issue
Block a user