diff options
author | Nicholas Clark <nick@ccl4.org> | 2008-01-11 12:14:04 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2008-01-11 12:14:04 +0000 |
commit | 14a49a2428492a7a120f0254ff8085e99252f641 (patch) | |
tree | 32e1575fa0e68d4c2eb45dc0c44f5e6e312c862a /pp_ctl.c | |
parent | ccb2c8b8ab146edc148e377cd6b108da77d1320b (diff) | |
download | perl-14a49a2428492a7a120f0254ff8085e99252f641.tar.gz |
REGEXPs are now stored directly in PL_regex_padav, rather than
indirectly via RVs. This saves memory, and removes 1 level of pointer
indirection.
p4raw-id: //depot/perl@32950
Diffstat (limited to 'pp_ctl.c')
-rw-r--r-- | pp_ctl.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -128,6 +128,7 @@ PP(pp_regcomp) STRLEN len; const char *t = SvOK(tmpstr) ? SvPV_const(tmpstr, len) : ""; re = PM_GETRE(pm); + assert (re != (REGEXP*) &PL_sv_undef); /* Check against the last compiled regexp. */ if (!re || !RX_PRECOMP(re) || RX_PRELEN(re) != len || @@ -137,7 +138,11 @@ PP(pp_regcomp) U32 pm_flags = pm->op_pmflags & PMf_COMPILETIME; if (re) { ReREFCNT_dec(re); +#ifdef USE_ITHREADS + PM_SETRE(pm, (REGEXP*) &PL_sv_undef); +#else PM_SETRE(pm, NULL); /* crucial if regcomp aborts */ +#endif } else if (PL_curcop->cop_hints_hash) { SV *ptr = Perl_refcounted_he_fetch(aTHX_ PL_curcop->cop_hints_hash, 0, "regcomp", 7, 0, 0); |