diff options
author | Nicholas Clark <nick@ccl4.org> | 2007-12-20 19:49:50 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2007-12-20 19:49:50 +0000 |
commit | ac572bf4fde55cf563ae338dfe4e12b22ebc6d80 (patch) | |
tree | fa0c5697d540c2039ef5fdaeea4f6506ca28199b /sv.c | |
parent | 82c0efa4e83781652347e2d8715e3fc7441c39d4 (diff) | |
download | perl-ac572bf4fde55cf563ae338dfe4e12b22ebc6d80.tar.gz |
Perl_newAV() can become a mathom by making newAV() a wrapper around
newSV_type() and tweaking Perl_sv_upgrade().
p4raw-id: //depot/perl@32675
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -1253,6 +1253,13 @@ Perl_sv_upgrade(pTHX_ register SV *sv, svtype new_type) AvMAX(sv) = -1; AvFILLp(sv) = -1; AvREAL_only(sv); + if (old_type >= SVt_RV) { + AvALLOC(sv) = 0; + } else { + /* It will have been zeroed when the new body was allocated. + Lets not write to it, in case it confuses a write-back + cache. */ + } } /* SVt_NULL isn't the only thing upgraded to AV or HV. |