diff --git a/ChangeLog b/ChangeLog index 2bb4e08..ae26ad8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -201,6 +201,10 @@ PCRE2_EXTRA_MATCH_WORD, and PCRE2_EXTRA_MATCH_LINE. This fixes two bugs: 44. Added configuration options for the SELinux compatible execmem allocator in JIT. +45. Increased the limit for searching for a "must be present" code unit in +subjects from 1000 to 2000 for 8-bit searches, since they use memchr() and are +much faster. + Version 10.23 14-February-2017 ------------------------------ diff --git a/src/pcre2_internal.h b/src/pcre2_internal.h index 02e1b9f..bc52b9a 100644 --- a/src/pcre2_internal.h +++ b/src/pcre2_internal.h @@ -557,9 +557,14 @@ enum { PCRE2_MATCHEDBY_INTERPRETER, /* pcre2_match() */ #define MAGIC_NUMBER 0x50435245UL /* 'PCRE' */ /* The maximum remaining length of subject we are prepared to search for a -req_unit match. */ +req_unit match. In 8-bit mode, memchr() is used and is much faster than the +search loop that has to be used in 16-bit and 32-bit modes. */ +#if PCRE2_CODE_UNIT_WIDTH == 8 +#define REQ_CU_MAX 2000 +#else #define REQ_CU_MAX 1000 +#endif /* Offsets for the bitmap tables in the cbits set of tables. Each table contains a set of bits for a class map. Some classes are built by combining