Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 1a871ce3a5385cd30b841c5e8e0413418e2bbe4b
      
https://github.com/Perl/perl5/commit/1a871ce3a5385cd30b841c5e8e0413418e2bbe4b
  Author: Richard Leach <[email protected]>
  Date:   2025-10-20 (Mon, 20 Oct 2025)

  Changed paths:
    M regexec.c

  Log Message:
  -----------
  AHOCORASICK - Reduce heap allocation overhead

A `U8*` structure is used to track character positions during Aho-Corasick
string searching. This used to always be allocated from the heap, and
wrapped in a mortal SV to avoid leakage. However, that incurs overhead.

Following this commit:
* A stack buffer is used if `maxlen` is small enough.
* Otherwise, the heap allocation is saved directly to the savestack
for freeing during stack unwinding.
* Since a mortal SV is no longer used, there is no need to `SAVETMPS`
and `FREETMPS` at scope entry/exit.



To unsubscribe from these emails, change your notification settings at 
https://github.com/Perl/perl5/settings/notifications

Reply via email to