#endif
if (sv && sv != &PL_sv_undef) {
SvTEMP_off(sv);
- SvREFCNT_dec(sv); /* note, can modify tmps_ix!!! */
+ SvREFCNT_dec_NN(sv); /* note, can modify tmps_ix!!! */
}
}
}
mg_set(ARG0_SV);
PL_localizing = 0;
}
- SvREFCNT_dec(ARG0_SV);
+ SvREFCNT_dec_NN(ARG0_SV);
SvREFCNT_dec(refsv);
break;
}
mg_set(ARG0_SV);
PL_localizing = 0;
}
- SvREFCNT_dec(ARG1_GV);
+ SvREFCNT_dec_NN(ARG1_GV);
break;
case SAVEt_HV: /* hash reference */
SvREFCNT_dec(GvHV(ARG1_GV));
mg_set(ARG0_SV);
PL_localizing = 0;
}
- SvREFCNT_dec(ARG1_GV);
+ SvREFCNT_dec_NN(ARG1_GV);
break;
case SAVEt_INT_SMALL:
*(int*)ARG0_PTR = (int)(uv >> SAVE_TIGHT_SHIFT);
/* putting a method back into circulation ("local")*/
gv_method_changed(ARG1_GV);
}
- SvREFCNT_dec(ARG1_GV);
+ SvREFCNT_dec_NN(ARG1_GV);
break;
}
case SAVEt_FREESV:
}
default: *svp = newSV(0); break;
}
- SvREFCNT_dec(sv); /* Cast current value to the winds. */
+ SvREFCNT_dec_NN(sv); /* Cast current value to the winds. */
/* preserve pad nature, but also mark as not live
* for any closure capturing */
SvFLAGS(*svp) |= (SVs_PADMY|SVs_PADSTALE);
=for apidoc Am|void|SvREFCNT_dec|SV* sv
Decrements the reference count of the given SV.
+=for apidoc Am|void|SvREFCNT_dec_NN|SV* sv
+Same as SvREFCNT_dec, but can only be used if you know I<sv>
+is not NULL. Since we don't have to check the NULLness, it's faster
+and smaller.
+
=for apidoc Am|svtype|SvTYPE|SV* sv
Returns the type of the SV. See C<svtype>.
#define SvREFCNT_inc_simple_void_NN(sv) (void)(++SvREFCNT(MUTABLE_SV(sv)))
#define SvREFCNT_dec(sv) S_SvREFCNT_dec(aTHX_ MUTABLE_SV(sv))
+#define SvREFCNT_dec_NN(sv) S_SvREFCNT_dec_NN(aTHX_ MUTABLE_SV(sv))
#define SVTYPEMASK 0xff
#define SvTYPE(sv) ((svtype)((sv)->sv_flags & SVTYPEMASK))