[Pcre-svn] [836] code/trunk: Increase limit for "must be pre…

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [836] code/trunk: Increase limit for "must be present" code units for 8-bit searches, which use
Revision: 836
          http://www.exim.org/viewvc/pcre2?view=rev&revision=836
Author:   ph10
Date:     2017-06-26 17:25:16 +0100 (Mon, 26 Jun 2017)
Log Message:
-----------
Increase limit for "must be present" code units for 8-bit searches, which use 
memchr().


Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/src/pcre2_internal.h


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2017-06-26 11:21:19 UTC (rev 835)
+++ code/trunk/ChangeLog    2017-06-26 16:25:16 UTC (rev 836)
@@ -201,7 +201,11 @@
 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
------------------------------


Modified: code/trunk/src/pcre2_internal.h
===================================================================
--- code/trunk/src/pcre2_internal.h    2017-06-26 11:21:19 UTC (rev 835)
+++ code/trunk/src/pcre2_internal.h    2017-06-26 16:25:16 UTC (rev 836)
@@ -557,9 +557,14 @@
 #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