diff options
author | Steffen Mueller <smueller@cpan.org> | 2012-09-12 14:52:46 +0200 |
---|---|---|
committer | Steffen Mueller <smueller@cpan.org> | 2012-09-16 13:41:38 +0200 |
commit | 22ade07d6a4f442c7a3e970195597fd0cb266e0d (patch) | |
tree | 7935b5cd24fe1992e6a4dc93b85f739ae944e6c3 | |
parent | a6075c7300c497a2e670c1d26bb60551c0075e32 (diff) | |
download | perl-22ade07d6a4f442c7a3e970195597fd0cb266e0d.tar.gz |
Save one NULL assignment per TMP
This assignment looks really rather like overzealous cleanliness.
It's a hot path. Now it's death by 999 cuts instead of 1000.
-rw-r--r-- | scope.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -160,8 +160,13 @@ Perl_free_tmps(pTHX) /* XXX should tmps_floor live in cxstack? */ const I32 myfloor = PL_tmps_floor; while (PL_tmps_ix > myfloor) { /* clean up after last statement */ - SV* const sv = PL_tmps_stack[PL_tmps_ix]; - PL_tmps_stack[PL_tmps_ix--] = NULL; +#ifdef PERL_POISON + SV* const sv = PL_tmps_stack[PL_tmps_ix]; + PoisonWith(sv, 1, sizeof(SV *), 0xAB); + PL_tmps_ix--; +#else + SV* const sv = PL_tmps_stack[PL_tmps_ix--]; +#endif if (sv && sv != &PL_sv_undef) { SvTEMP_off(sv); SvREFCNT_dec(sv); /* note, can modify tmps_ix!!! */ |