2018-06-28 18:26:03 +02:00
|
|
|
.TH PCRE2_JIT_STACK_ASSIGN 3 "28 June 2018" "PCRE2 10.32"
|
2014-10-21 18:33:30 +02:00
|
|
|
.SH NAME
|
|
|
|
PCRE2 - Perl-compatible regular expressions (revised API)
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.rs
|
|
|
|
.sp
|
|
|
|
.B #include <pcre2.h>
|
|
|
|
.PP
|
|
|
|
.nf
|
2014-11-08 17:07:30 +01:00
|
|
|
.B void pcre2_jit_stack_assign(pcre2_match_context *\fImcontext\fP,
|
2014-10-21 18:33:30 +02:00
|
|
|
.B " pcre2_jit_callback \fIcallback_function\fP, void *\fIcallback_data\fP);"
|
|
|
|
.fi
|
|
|
|
.
|
|
|
|
.SH DESCRIPTION
|
|
|
|
.rs
|
|
|
|
.sp
|
2014-11-11 17:51:07 +01:00
|
|
|
This function provides control over the memory used by JIT as a run-time stack
|
2014-11-08 17:07:30 +01:00
|
|
|
when \fBpcre2_match()\fP or \fBpcre2_jit_match()\fP is called with a pattern
|
|
|
|
that has been successfully processed by the JIT compiler. The information that
|
|
|
|
determines which stack is used is put into a match context that is subsequently
|
|
|
|
passed to a matching function. The arguments of this function are:
|
2014-10-21 18:33:30 +02:00
|
|
|
.sp
|
2014-11-08 17:07:30 +01:00
|
|
|
mcontext a pointer to a match context
|
2014-10-21 18:33:30 +02:00
|
|
|
callback a callback function
|
|
|
|
callback_data a JIT stack or a value to be passed to the callback
|
|
|
|
.P
|
2018-06-28 18:26:03 +02:00
|
|
|
If \fImcontext\fP is NULL, the function returns immediately, without doing
|
|
|
|
anything.
|
|
|
|
.P
|
2018-06-18 16:03:33 +02:00
|
|
|
If \fIcallback\fP is NULL and \fIcallback_data\fP is NULL, an internal 32KiB
|
2014-10-21 18:33:30 +02:00
|
|
|
block on the machine stack is used.
|
|
|
|
.P
|
|
|
|
If \fIcallback\fP is NULL and \fIcallback_data\fP is not NULL,
|
|
|
|
\fIcallback_data\fP must be a valid JIT stack, the result of calling
|
2014-11-03 18:13:00 +01:00
|
|
|
\fBpcre2_jit_stack_create()\fP.
|
2014-10-21 18:33:30 +02:00
|
|
|
.P
|
|
|
|
If \fIcallback\fP not NULL, it is called with \fIcallback_data\fP as an
|
|
|
|
argument at the start of matching, in order to set up a JIT stack. If the
|
2018-06-18 16:03:33 +02:00
|
|
|
result is NULL, the internal 32KiB stack is used; otherwise the return value
|
|
|
|
must be a valid JIT stack, the result of calling
|
|
|
|
\fBpcre2_jit_stack_create()\fP.
|
2014-10-21 18:33:30 +02:00
|
|
|
.P
|
2014-11-08 17:07:30 +01:00
|
|
|
You may safely use the same JIT stack for multiple patterns, as long as they
|
2014-10-21 18:33:30 +02:00
|
|
|
are all matched in the same thread. In a multithread application, each thread
|
|
|
|
must use its own JIT stack. For more details, see the
|
|
|
|
.\" HREF
|
|
|
|
\fBpcre2jit\fP
|
|
|
|
.\"
|
|
|
|
page.
|
|
|
|
.P
|
|
|
|
There is a complete description of the PCRE2 native API in the
|
|
|
|
.\" HREF
|
|
|
|
\fBpcre2api\fP
|
|
|
|
.\"
|
|
|
|
page and a description of the POSIX API in the
|
|
|
|
.\" HREF
|
|
|
|
\fBpcre2posix\fP
|
|
|
|
.\"
|
|
|
|
page.
|