This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
use new cleanup for PL_regmatch_state
The previous commit reorganised state save and cleanup at the end of regex
execution. Use this new mechanism, by recording the original values
of PL_regmatch_slab and PL_regmatch_state in the regmatch_info_aux struct,
and restoring them and freeing higher slabs as part of the general
S_cleanup_regmatch_info_aux() destructor, rather than pushing the old
values directly onto the savestack and using another specific destructor.
Also, make the initial allocating of (up to) 3 PL_regmatch_state slots
more efficient by doing it in a loop.
We also skip the first slot; this may already be in use if we're called
reentrantly.
try 1