diff options
author | Nicholas Clark <nick@ccl4.org> | 2002-08-15 01:10:35 +0100 |
---|---|---|
committer | hv <hv@crypt.org> | 2002-08-17 02:07:24 +0000 |
commit | 765f542df20317f47bb284c276cd0abfb50dcfd6 (patch) | |
tree | be92963942496ba900bdfb32c5b522ba355aafb0 /pp_hot.c | |
parent | 6f12eb6d2a1dfaf441504d869b27d2e40ef4966a (diff) | |
download | perl-765f542df20317f47bb284c276cd0abfb50dcfd6.tar.gz |
Copy On Write
Message-id: <20020815001035.A69079@plum.flirble.org>
specify "-Accflags='-DPERL_COPY_ON_WRITE'" to use
p4raw-id: //depot/perl@17728
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1610,7 +1610,11 @@ PP(pp_helem) U32 lval = PL_op->op_flags & OPf_MOD || LVRET; U32 defer = PL_op->op_private & OPpLVAL_DEFER; SV *sv; +#ifdef PERL_COPY_ON_WRITE + U32 hash = (SvIsCOW_shared_hash(keysv)) ? SvUVX(keysv) : 0; +#else U32 hash = (SvFAKE(keysv) && SvREADONLY(keysv)) ? SvUVX(keysv) : 0; +#endif I32 preeminent = 0; if (SvTYPE(hv) == SVt_PVHV) { @@ -1886,8 +1890,8 @@ PP(pp_subst) EXTEND(SP,1); } - if (SvFAKE(TARG) && SvREADONLY(TARG)) - sv_force_normal(TARG); + if (SvIsCOW(TARG)) + sv_force_normal_flags(TARG,0); if (SvREADONLY(TARG) || (SvTYPE(TARG) > SVt_PVLV && !(SvTYPE(TARG) == SVt_PVGV && SvFAKE(TARG)))) |