PCRE2_JIT_STACK_ASSIGN(3)

πŸ’– NAME πŸ’–

PCRE2 - Perl-compatible regular expressions (revised API) β€” and hi bestie, welcome to the PCRE2_JIT_STACK_ASSIGN(3) page from the Library Functions Manual πŸ’…βœ¨

✨ SYNOPSIS ✨

#include <pcre2.h>

void pcre2_jit_stack_assign(pcre2_match_context *mcontext,
  pcre2_jit_callback callback_function, void *callback_data);

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so this function is literally your control room for the memory that JIT uses as a run-time stack when pcre2_match() or pcre2_jit_match() is called with a pattern that has been successfully processed by the JIT compiler. The info that determines which stack is used gets put into a match context that is subsequently passed to a matching function. The arguments are:

  • mcontext β€” a pointer to a match context
  • callback β€” a callback function
  • callback_data β€” a JIT stack or a value to be passed to the callback

If mcontext is NULL, the function returns immediately, without doing anything. No cap, it just leaves the group chat.

If callback is NULL and callback_data is NULL, an internal 32KiB block on the machine stack is used.

If callback is NULL and callback_data is not NULL, callback_data must be a valid JIT stack, the result of calling pcre2_jit_stack_create().

If callback is not NULL, it is called with callback_data as an argument at the start of matching, in order to set up a JIT stack. If the result is NULL, the internal 32KiB stack is used; otherwise the return value must be a valid JIT stack, the result of calling pcre2_jit_stack_create().

You may safely use the same JIT stack for multiple patterns, as long as they are all matched in the same thread. In a multithread application, each thread must use its own JIT stack. For more details, see the pcre2jit page.

There is a complete description of the PCRE2 native API in the pcre2api page and a description of the POSIX API in the pcre2posix page.


That’s the whole page, bestie 🫢 β€” PCRE2 10.47, dated 13 August 2018, signing off from PCRE2_JIT_STACK_ASSIGN(3) πŸ’œπŸŽ€

πŸ“¦ where this page comes from