diff options
author | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2017-07-05 15:45:39 +0000 |
---|---|---|
committer | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2017-07-05 15:45:39 +0000 |
commit | b847a5066e287003b904df7eda4f74edb8096a9c (patch) | |
tree | f51b3d439813068ef61d14b0cec3086ea65692b8 /doc/pcre.txt | |
parent | 0dd2f62bf7d59f66444a13e53f65344280c6fce6 (diff) | |
download | pcre-b847a5066e287003b904df7eda4f74edb8096a9c.tar.gz |
Final file tidies for 8.41 release.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1706 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'doc/pcre.txt')
-rw-r--r-- | doc/pcre.txt | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/doc/pcre.txt b/doc/pcre.txt index 3614724..c027538 100644 --- a/doc/pcre.txt +++ b/doc/pcre.txt @@ -8366,8 +8366,10 @@ AVAILABILITY OF JIT SUPPORT 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. - Also beware that the pcre_jit_exec() function was not available before - 8.32. See "JIT FAST PATH API" section below for details. + 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 @@ -8409,6 +8411,18 @@ SIMPLE USE OF JIT 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 @@ -8704,6 +8718,27 @@ JIT FAST PATH API 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 @@ -8719,7 +8754,7 @@ AUTHOR REVISION - Last updated: 13 June 2017 + Last updated: 05 July 2017 Copyright (c) 1997-2017 University of Cambridge. ------------------------------------------------------------------------------ |