PCRE_JIT_STACK_ALLOC(3)

πŸ’– NAME πŸ’–

PCRE β€” Perl-compatible regular expressions ✨


πŸŽ€ SYNOPSIS πŸŽ€

#include <pcre.h>

pcre_jit_stack *pcre_jit_stack_alloc(int startsize,
     int maxsize);

pcre16_jit_stack *pcre16_jit_stack_alloc(int startsize,
     int maxsize);

pcre32_jit_stack *pcre32_jit_stack_alloc(int startsize,
     int maxsize);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay bestie so listen β€” this function makes you a stack for the code that got compiled by the JIT optimization of pcre[16|32]_study(). that's it, that's the job πŸ’…

the arguments are:

  • a starting size for the stack, and
  • a maximum size that it's allowed to grow up to.

and once you've got that lil stack in your hands? you can hand it over to the JIT run-time code via pcre[16|32]_assign_jit_stack(), OR that same function can set up a callback for getting a stack instead. either way works, pick your vibe 🫢

ngl, a max stack size of 512K to 1M should be more than enough for any pattern. like, any pattern. don't overthink it, she's covered πŸ’€βœ¨

for more deets, go read the pcrejit page β€” it's giving lore.

there's a complete description of the PCRE native API in the pcreapi page, and a description of the POSIX API in the pcreposix page. yes both. go read them, they ate πŸ‘‘


PCRE 8.30 🩷 24 June 2012 β€” yeah she's an icon from back in the day, still serving, still slaying, mwah πŸ’‹ periodt.