Skip to content

Commit

Permalink
Merge branch 'github_develop' into github_master
Browse files Browse the repository at this point in the history
  • Loading branch information
hongyang7 committed Oct 30, 2019
2 parents 4cebdaa + a15927a commit d79973e
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

This is a list of notable changes to Hyperscan, in reverse chronological order.

## [5.2.1] 2019-10-13
- Bugfix for issue #186: fix compile issue when `BUILD_SHARED_LIBS` is on in
release mode.
- Disable redundant move check for older compiler versions.

## [5.2.0] 2019-07-12
- Literal API: add new API `hs_compile_lit()` and `hs_compile_lit_multi()` to
process pure literal rule sets. The 2 literal APIs treat each expression text
Expand Down
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ project (hyperscan C CXX)

set (HS_MAJOR_VERSION 5)
set (HS_MINOR_VERSION 2)
set (HS_PATCH_VERSION 0)
set (HS_PATCH_VERSION 1)
set (HS_VERSION ${HS_MAJOR_VERSION}.${HS_MINOR_VERSION}.${HS_PATCH_VERSION})

set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
Expand Down Expand Up @@ -395,6 +395,12 @@ if (CXX_IGNORED_ATTR)
set(EXTRA_CXX_FLAGS "${EXTRA_CXX_FLAGS} -Wno-ignored-attributes")
endif()

# gcc 9 complains about redundant move for returned variable
CHECK_CXX_COMPILER_FLAG("-Wredundant-move" CXX_REDUNDANT_MOVE)
if (CXX_REDUNDANT_MOVE)
set(EXTRA_CXX_FLAGS "${EXTRA_CXX_FLAGS} -Wno-redundant-move")
endif()

# note this for later
# g++ doesn't have this flag but clang does
CHECK_CXX_COMPILER_FLAG("-Wweak-vtables" CXX_WEAK_VTABLES)
Expand Down
5 changes: 3 additions & 2 deletions doc/dev-reference/compilation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -613,8 +613,9 @@ When an expression has the :c:member:`HS_FLAG_COMBINATION` flag set, it ignores
all other flags except the :c:member:`HS_FLAG_SINGLEMATCH` flag and the
:c:member:`HS_FLAG_QUIET` flag.
Hyperscan will reject logical combination expressions at compile time that
evaluate to *true* when no patterns have matched; for example: ::
Hyperscan will accept logical combination expressions at compile time that
evaluate to *true* when no patterns have matched, and report the match for
combination at end of data if no patterns have matched; for example: ::
!101
!101|102
Expand Down
21 changes: 21 additions & 0 deletions tools/hsbench/engine_hyperscan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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();
Expand Down
5 changes: 2 additions & 3 deletions tools/hscheck/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(&regexp, &flags, nullptr, &extp,
&len, 1, mode, nullptr, &db,
&compile_err, *g_grey);
err = hs_compile_lit_multi(&regexp, &flags, nullptr, &len, 1,
mode, nullptr, &db, &compile_err);
} else {
err = hs_compile_ext_multi(&regexp, &flags, nullptr, &extp, 1,
mode, nullptr, &db, &compile_err);
Expand Down

0 comments on commit d79973e

Please sign in to comment.