This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
make PL_reg_curpm global
authorDavid Mitchell <davem@iabyn.com>
Fri, 31 May 2013 20:39:01 +0000 (21:39 +0100)
committerDavid Mitchell <davem@iabyn.com>
Sun, 2 Jun 2013 21:28:54 +0000 (22:28 +0100)
commitf65e70f560c80556143956eb9980619a9dfbe2f4
treed9c327235913d5c127fe44da874c403a668b4022
parent1cb95af747617861d08c1213f05d8f1e4b55f942
make PL_reg_curpm global

Currently PL_reg_curpm is actually #deffed to a field within PL_reg_state;
promote it into a fully autonomous perl-interpreter variable.

PL_reg_curpm points to a fake PMOP that's used to temporarily point
PL_curpm to, that we can hang the current regex off, so that this works:

    "a" =~ /^(.)(?{ print $1 })/ # prints 'a'

It turns out that it doesn't need to be saved and restored when we
recursively enter the regex engine; that is already handled by saving and
restoring which regex is currently attached to PL_reg_curpm.
So we just need a single global (per interpreter) placeholder.

Since we're shortly going to get rid of PL_reg_state, we need to move it
out of that struct.
embedvar.h
intrpvar.h
perl.c
regexec.c
regexp.h
sv.c