Design compile time api hs_compile_lit() and hs_compile_lit_multi()
to handle pure literal pattern sets. Corresponding option --literal-on
is added for hyperscan testing suites. Extended parameters and part of
flags are not supported for this api.
These non-packed structures are placed into a std::vector. Later, they
contents of the vector are memcpy'd and the CRC of this space is taken.
Some compilers will zero the struct padding but GCC8.2 with -O2 at least
will not. This means that the CRC is based on uninitialized memory.
Since it is expected that these bytes will be memcpy'd, zero in place once
they're in the std::vector.
Found by Valgrind.
Q.v. Issue #148
During fat runtime function resolution there was a chance that the PLT
might not be initialised in time for us to call the cpuid check
functions. Moving them inline means there is no PLT to worry about.
Fixes#78
We use the small_vector constructors introduced in Boost 1.61 (trac bug
11866, github commit b436c91). If the Boost version is too old, we fall
back to using std::vector.
This commit replaces the ue2::unordered_{set,map} types with their STL
versions, with some new hashing utilities in util/hash.h. The new types
ue2_unordered_set<T> and ue2_unordered_map<Key, T> default to using the
ue2_hasher.
The header util/ue2_containers.h has been removed, and the flat_set/map
containers moved to util/flat_containers.h.
- Use a queue rather than always building the full vector of state
sets.
- Make more use of move, emplace, reserve.
- Write directly into dstates argument.
- Return bool rather than int.
The STL shipped with gcc-4.8 does not provide
vector::erase(const_iterator) for C++11, instead only taking a mutable
iterator. This causes problems with flat_set/map if we don't have
Boost small_vector available and we fall back to std::vector.
We work around this by providing a function to construct a mutable
iterator given a const_iterator for internal use.