summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2017-07-05 10:29:42 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2017-07-05 10:29:42 +0000
commit0dd2f62bf7d59f66444a13e53f65344280c6fce6 (patch)
tree3dd800b2b540f4df56335571eefc82b970b9fa0c
parent90f29ca7fd20f31bf05ba8f996944663b1e7c5ed (diff)
downloadpcre-0dd2f62bf7d59f66444a13e53f65344280c6fce6.tar.gz
Documentation update.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1705 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r--doc/pcrejit.343
1 files changed, 39 insertions, 4 deletions
diff --git a/doc/pcrejit.3 b/doc/pcrejit.3
index b02d52c..3b785f0 100644
--- a/doc/pcrejit.3
+++ b/doc/pcrejit.3
@@ -1,4 +1,4 @@
-.TH PCREJIT 3 "13 June 2017" "PCRE 8.41"
+.TH PCREJIT 3 "05 July 2017" "PCRE 8.41"
.SH NAME
PCRE - Perl-compatible regular expressions
.SH "PCRE JUST-IN-TIME COMPILER SUPPORT"
@@ -57,8 +57,9 @@ 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. Also beware that the
-\fBpcre_jit_exec()\fP function was not available before 8.32. See "JIT FAST
-PATH API" section below for details.
+\fBpcre_jit_exec()\fP 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.
.
.
.SH "SIMPLE USE OF JIT"
@@ -98,6 +99,19 @@ when you call \fBpcre_study()\fP:
PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE
PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE
.sp
+If using \fBpcre_jit_exec()\fP and supporting a pre-8.32 version of
+PCRE, you can insert:
+.sp
+ #if PCRE_MAJOR >= 8 && PCRE_MINOR >= 32
+ pcre_jit_exec(...);
+ #else
+ pcre_exec(...)
+ #endif
+.sp
+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.
+.sp
The JIT compiler generates different optimized code for each of the three
modes (normal, soft partial, hard partial). When \fBpcre_exec()\fP is called,
the appropriate code is run if it is available. Otherwise, the pattern is
@@ -411,6 +425,27 @@ Note that the \fBpcre_jit_exec()\fP 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 \fBpcre_exec()\fP, or switch between
the two codepaths by checking the values of PCRE_MAJOR and PCRE_MINOR.
+.P
+Due to an unfortunate implementation oversight, even in versions 8.32
+and later there will be no \fBpcre_jit_exec()\fP 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.
+.P
+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
+\fBpcre_exec()\fP, or switch between the two codepaths by checking the
+values of PCRE_MAJOR and PCRE_MINOR.
+.P
+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 \fBpcre_exec()\fP must be
+used, or a compile-time check for JIT via \fBpcre_config()\fP (which
+assumes the runtime environment will be the same), or as the Git
+project decided to do, simply assume that \fBpcre_jit_exec()\fP 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.
.
.
.SH "SEE ALSO"
@@ -433,6 +468,6 @@ Cambridge CB2 3QH, England.
.rs
.sp
.nf
-Last updated: 13 June 2017
+Last updated: 05 July 2017
Copyright (c) 1997-2017 University of Cambridge.
.fi