PCRE2_SET_RECURSION_MEMORY_MANAGEMENT(3)

✨ PCRE2_SET_RECURSION_MEMORY_MANAGEMENT ✨

okay so bestie, real talk β€” welcome to the pcre2_set_recursion_memory_management page πŸ’… it lives in the Library Functions Manual (the fancy section of the manual, iykyk), and it's part of PCRE2, aka Perl-compatible regular expressions (revised API). she's iconic, she's historic, she's… mostly retired. let's get into it πŸŽ€


🌸 NAME 🌸

PCRE2 β€” Perl-compatible regular expressions (revised API). that's the whole name section, short and slay πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

okay so here's the actual signature, copy it exactly, no cap:

#include <pcre2.h>

int pcre2_set_recursion_memory_management(
  pcre2_match_context *mcontext,
  void *(*private_malloc)(size_t, void *),
  void (*private_free)(void *, void *), void *memory_data);

like, she looks like she takes four whole arguments and does something important. she does not. keep reading 😭


πŸ‘‘ DESCRIPTION πŸ‘‘

THE BIG NEWS: from release 10.30 onwards, this function is obsolete and literally does nothing. absolutely zero. no cap. 🫢

the result is always zero β€” that's the one thing you can count on her for, bestie. she's giving retiree-at-the-function-party energy πŸ’€

so like, if you're calling this expecting it to set up any recursion memory management… she's not doing that. she hasn't been doing that since 10.30. it's giving "washed up but still on the guest list" honestly πŸ™ˆ

⭐ reminder: the return value is always zero. yes, even then. even if you're sure. always zero. ✨

want the actual tea on how PCRE2 works? there's a complete description of the PCRE2 native API over on the pcre2api page, and a description of the POSIX API on the pcre2posix page. go read those, they ate πŸ”₯


🌈 SEE ALSO 🌈

  • pcre2api β€” the complete description of the PCRE2 native API πŸ’–
  • pcre2posix β€” the description of the POSIX API πŸ¦‹

kk that's the whole page, you're officially educated πŸ’… stay hydrated, go read pcre2api, and remember: if some code is calling pcre2_set_recursion_memory_management expecting it to do something, it's gonna get a zero and a vibe check 😭

mwah πŸ’œ β€” this has been PCRE2 10.47, dated 23 January 2023, signing off from the Library Functions Manual. periodt πŸŽ€

πŸ“¦ where this page comes from