blob: 6cc17880f10de3e56b755f2d8ecffe531b332228 [file] [log] [blame]
Elliott Hughes2dbd7d22020-06-03 14:32:37 -07001.TH PCRE2_JIT_COMPILE 3 "29 July 2019" "PCRE2 10.34"
Janis Danisevskis112c9cc2016-03-31 13:35:25 +01002.SH NAME
3PCRE2 - Perl-compatible regular expressions (revised API)
4.SH SYNOPSIS
5.rs
6.sp
7.B #include <pcre2.h>
8.PP
9.nf
10.B int pcre2_jit_compile(pcre2_code *\fIcode\fP, uint32_t \fIoptions\fP);
11.fi
12.
13.SH DESCRIPTION
14.rs
15.sp
16This function requests JIT compilation, which, if the just-in-time compiler is
17available, further processes a compiled pattern into machine code that executes
18much faster than the \fBpcre2_match()\fP interpretive matching function. Full
19details are given in the
20.\" HREF
21\fBpcre2jit\fP
22.\"
23documentation.
24.P
25The first argument is a pointer that was returned by a successful call to
26\fBpcre2_compile()\fP, and the second must contain one or more of the following
27bits:
28.sp
29 PCRE2_JIT_COMPLETE compile code for full matching
30 PCRE2_JIT_PARTIAL_SOFT compile code for soft partial matching
31 PCRE2_JIT_PARTIAL_HARD compile code for hard partial matching
Janis Danisevskis112c9cc2016-03-31 13:35:25 +010032.sp
Elliott Hughes2dbd7d22020-06-03 14:32:37 -070033There is also an obsolete option called PCRE2_JIT_INVALID_UTF, which has been
34superseded by the \fBpcre2_compile()\fP option PCRE2_MATCH_INVALID_UTF. The old
35option is deprecated and may be removed in the future.
36.P
Janis Danisevskis112c9cc2016-03-31 13:35:25 +010037The yield of the function is 0 for success, or a negative error code otherwise.
38In particular, PCRE2_ERROR_JIT_BADOPTION is returned if JIT is not supported or
Elliott Hughes2dbd7d22020-06-03 14:32:37 -070039if an unknown bit is set in \fIoptions\fP. The function can also return
40PCRE2_ERROR_NOMEMORY if JIT is unable to allocate executable memory for the
41compiler, even if it was because of a system security restriction.
Janis Danisevskis112c9cc2016-03-31 13:35:25 +010042.P
43There is a complete description of the PCRE2 native API in the
44.\" HREF
45\fBpcre2api\fP
46.\"
47page and a description of the POSIX API in the
48.\" HREF
49\fBpcre2posix\fP
50.\"
51page.