From 4b47e5a4bb656ebb5bd493d1ad6f79eaf4f298e1 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Wed, 29 Nov 2017 12:27:04 +0300 Subject: Pcre16: lib updated to 8.41 --- libs/Pcre16/docs/doc/html/pcrejit.html | 57 +++++++++++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 5 deletions(-) (limited to 'libs/Pcre16/docs/doc/html/pcrejit.html') diff --git a/libs/Pcre16/docs/doc/html/pcrejit.html b/libs/Pcre16/docs/doc/html/pcrejit.html index 210f1da026..abb342522f 100644 --- a/libs/Pcre16/docs/doc/html/pcrejit.html +++ b/libs/Pcre16/docs/doc/html/pcrejit.html @@ -79,9 +79,12 @@ API that is JIT-specific.

If your program may sometimes be linked with versions of PCRE that are older -than 8.20, but you want to use JIT when it is available, you can test -the values of PCRE_MAJOR and PCRE_MINOR, or the existence of a JIT macro such -as PCRE_CONFIG_JIT, for compile-time control of your code. +than 8.20, but you want to use JIT when it is available, you can test the +values of PCRE_MAJOR and PCRE_MINOR, or the existence of a JIT macro such as +PCRE_CONFIG_JIT, for compile-time control of your code. Also beware that the +pcre_jit_exec() function was not available at all before 8.32, +and may not be available at all if PCRE isn't compiled with +--enable-jit. See the "JIT FAST PATH API" section below for details.


SIMPLE USE OF JIT

@@ -119,6 +122,20 @@ when you call pcre_study(): PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE +If using pcre_jit_exec() and supporting a pre-8.32 version of +PCRE, you can insert: +

+   #if PCRE_MAJOR >= 8 && PCRE_MINOR >= 32
+   pcre_jit_exec(...);
+   #else
+   pcre_exec(...)
+   #endif
+
+but as described in the "JIT FAST PATH API" section below this assumes +version 8.32 and later are compiled with --enable-jit, which may +break. +
+
The JIT compiler generates different optimized code for each of the three modes (normal, soft partial, hard partial). When pcre_exec() is called, the appropriate code is run if it is available. Otherwise, the pattern is @@ -428,6 +445,36 @@ fast path, and if invalid data is passed, the result is undefined. Bypassing the sanity checks and the pcre_exec() wrapping can give speedups of more than 10%.

+

+Note that the pcre_jit_exec() function is not available in versions of +PCRE before 8.32 (released in November 2012). If you need to support versions +that old you must either use the slower pcre_exec(), or switch between +the two codepaths by checking the values of PCRE_MAJOR and PCRE_MINOR. +

+

+Due to an unfortunate implementation oversight, even in versions 8.32 +and later there will be no pcre_jit_exec() stub function defined +when PCRE is compiled with --disable-jit, which is the default, and +there's no way to detect whether PCRE was compiled with --enable-jit +via a macro. +

+

+If you need to support versions older than 8.32, or versions that may +not build with --enable-jit, you must either use the slower +pcre_exec(), or switch between the two codepaths by checking the +values of PCRE_MAJOR and PCRE_MINOR. +

+

+Switching between the two by checking the version assumes that all the +versions being targeted are built with --enable-jit. To also support +builds that may use --disable-jit either pcre_exec() must be +used, or a compile-time check for JIT via pcre_config() (which +assumes the runtime environment will be the same), or as the Git +project decided to do, simply assume that pcre_jit_exec() is +present in 8.32 or later unless a compile-time flag is provided, see +the "grep: un-break building with PCRE >= 8.32 without --enable-jit" +commit in git.git for an example of that. +


SEE ALSO

pcreapi(3) @@ -443,9 +490,9 @@ Cambridge CB2 3QH, England.


REVISION

-Last updated: 17 March 2013 +Last updated: 05 July 2017
-Copyright © 1997-2013 University of Cambridge. +Copyright © 1997-2017 University of Cambridge.

Return to the PCRE index page. -- cgit v1.2.3