Perl_pad_undef(pTHX_ CV* cv)
{
I32 ix;
- const PADLIST *padlist = CvPADLIST(cv);
+ const PADLIST * const padlist = CvPADLIST(cv);
if (!padlist)
return;
Perl_pad_add_anon(pTHX_ SV* sv, OPCODE op_type)
{
PADOFFSET ix;
- SV* name;
-
- name = NEWSV(1106, 0);
+ SV* const name = NEWSV(1106, 0);
sv_upgrade(name, SVt_PVNV);
sv_setpvn(name, "&", 1);
SvIV_set(name, -1);
I32 offset, new_offset;
SV *new_capture;
SV **new_capturep;
- const AV *padlist = CvPADLIST(cv);
+ const AV * const padlist = CvPADLIST(cv);
*out_flags = 0;
if (refadjust)
SvREFCNT_dec(PL_curpad[po]);
+
+ /* if pad tmps aren't shared between ops, then there's no need to
+ * create a new tmp when an existing op is freed */
+#ifdef USE_BROKEN_PAD_RESET
PL_curpad[po] = NEWSV(1107,0);
SvPADTMP_on(PL_curpad[po]);
+#else
+ PL_curpad[po] = &PL_sv_undef;
+#endif
if ((I32)po < PL_padix)
PL_padix = po - 1;
}