| 82 |
pcre_free(study_ptr); |
pcre_free(study_ptr); |
| 83 |
#endif |
#endif |
| 84 |
.sp |
.sp |
| 85 |
PCRE_STUDY_JIT_COMPILE requests the JIT compiler to generate code for complete |
PCRE_STUDY_JIT_COMPILE requests the JIT compiler to generate code for complete |
| 86 |
matches. If you want to run partial matches using the PCRE_PARTIAL_HARD or |
matches. If you want to run partial matches using the PCRE_PARTIAL_HARD or |
| 87 |
PCRE_PARTIAL_SOFT options of \fBpcre_exec()\fP, you should set one or both of |
PCRE_PARTIAL_SOFT options of \fBpcre_exec()\fP, you should set one or both of |
| 88 |
the following options in addition to, or instead of, PCRE_STUDY_JIT_COMPILE |
the following options in addition to, or instead of, PCRE_STUDY_JIT_COMPILE |
| 108 |
no JIT data is created. Otherwise, the compiled pattern is passed to the JIT |
no JIT data is created. Otherwise, the compiled pattern is passed to the JIT |
| 109 |
compiler, which turns it into machine code that executes much faster than the |
compiler, which turns it into machine code that executes much faster than the |
| 110 |
normal interpretive code. When \fBpcre_exec()\fP is passed a \fBpcre_extra\fP |
normal interpretive code. When \fBpcre_exec()\fP is passed a \fBpcre_extra\fP |
| 111 |
block containing a pointer to JIT code of the appropriate mode (normal or |
block containing a pointer to JIT code of the appropriate mode (normal or |
| 112 |
hard/soft partial), it obeys that code instead of running the interpreter. The |
hard/soft partial), it obeys that code instead of running the interpreter. The |
| 113 |
result is identical, but the compiled JIT code runs much faster. |
result is identical, but the compiled JIT code runs much faster. |
| 114 |
.P |
.P |
| 149 |
.sp |
.sp |
| 150 |
\eC match a single byte; not supported in UTF-8 mode |
\eC match a single byte; not supported in UTF-8 mode |
| 151 |
(?Cn) callouts |
(?Cn) callouts |
| 152 |
(*PRUNE) ) |
(*PRUNE) ) |
| 153 |
(*SKIP) ) backtracking control verbs |
(*SKIP) ) backtracking control verbs |
| 154 |
(*THEN) ) |
(*THEN) ) |
| 155 |
.sp |
.sp |
| 239 |
(2) If \fIcallback\fP is NULL and \fIdata\fP is not NULL, \fIdata\fP must be |
(2) If \fIcallback\fP is NULL and \fIdata\fP is not NULL, \fIdata\fP must be |
| 240 |
a valid JIT stack, the result of calling \fBpcre_jit_stack_alloc()\fP. |
a valid JIT stack, the result of calling \fBpcre_jit_stack_alloc()\fP. |
| 241 |
.sp |
.sp |
| 242 |
(3) If \fIcallback\fP is not NULL, it must point to a function that is |
(3) If \fIcallback\fP is not NULL, it must point to a function that is |
| 243 |
called with \fIdata\fP as an argument at the start of matching, in |
called with \fIdata\fP as an argument at the start of matching, in |
| 244 |
order to set up a JIT stack. If the return from the callback |
order to set up a JIT stack. If the return from the callback |
| 245 |
function is NULL, the internal 32K stack is used; otherwise the |
function is NULL, the internal 32K stack is used; otherwise the |
| 246 |
return value must be a valid JIT stack, the result of calling |
return value must be a valid JIT stack, the result of calling |
| 247 |
\fBpcre_jit_stack_alloc()\fP. |
\fBpcre_jit_stack_alloc()\fP. |
| 248 |
.sp |
.sp |
| 249 |
A callback function is obeyed whenever JIT code is about to be run; it is not |
A callback function is obeyed whenever JIT code is about to be run; it is not |
| 250 |
obeyed when \fBpcre_exec()\fP is called with options that are incompatible for |
obeyed when \fBpcre_exec()\fP is called with options that are incompatible for |
| 251 |
JIT execution. A callback function can therefore be used to determine whether a |
JIT execution. A callback function can therefore be used to determine whether a |
| 252 |
match operation was executed by JIT or by the interpreter. |
match operation was executed by JIT or by the interpreter. |
| 253 |
.P |
.P |
| 254 |
You may safely use the same JIT stack for more than one pattern (either by |
You may safely use the same JIT stack for more than one pattern (either by |
| 255 |
assigning directly or by callback), as long as the patterns are all matched |
assigning directly or by callback), as long as the patterns are all matched |
| 256 |
sequentially in the same thread. In a multithread application, if you do not |
sequentially in the same thread. In a multithread application, if you do not |
| 257 |
specify a JIT stack, or if you assign or pass back NULL from a callback, that |
specify a JIT stack, or if you assign or pass back NULL from a callback, that |
| 258 |
is thread-safe, because each thread has its own machine stack. However, if you |
is thread-safe, because each thread has its own machine stack. However, if you |
| 259 |
assign or pass back a non-NULL JIT stack, this must be a different stack for |
assign or pass back a non-NULL JIT stack, this must be a different stack for |
| 260 |
each thread so that the application is thread-safe. |
each thread so that the application is thread-safe. |
| 261 |
.P |
.P |
| 262 |
Strictly speaking, even more is allowed. You can assign the same non-NULL stack |
Strictly speaking, even more is allowed. You can assign the same non-NULL stack |