if (gimme == G_ARRAY) {
if (SvLEN(sv) - SvCUR(sv) > 20) {
SvLEN_set(sv, SvCUR(sv)+1);
- Renew(SvPVX(sv), SvLEN(sv), char);
+ SvPV_renew(sv, SvLEN(sv));
}
sv = sv_2mortal(NEWSV(58, 80));
continue;
const STRLEN new_len
= SvCUR(sv) < 60 ? 80 : SvCUR(sv)+40; /* allow some slop */
SvLEN_set(sv, new_len);
- Renew(SvPVX(sv), SvLEN(sv), char);
+ SvPV_renew(sv, SvLEN(sv));
}
RETURN;
}
XPUSHs(sv_2mortal(sv));
if (SvLEN(sv) - SvCUR(sv) > 20) {
SvLEN_set(sv, SvCUR(sv)+1);
- Renew(SvPVX(sv), SvLEN(sv), char);
+ SvPV_renew(sv, SvLEN(sv));
}
SvTAINTED_on(sv);
}
STMT_START { assert(SvTYPE(sv) >= SVt_PV); \
(SvCUR(sv) = (val) - SvPVX(sv)); } STMT_END
+#define SvPV_renew(sv,n) \
+ (SvPV_set((sv), (MEM_WRAP_CHECK_(n,char) \
+ (char*)saferealloc((Malloc_t)SvPVX(sv),(MEM_SIZE)((n))))))
+
#define BmRARE(sv) ((XPVBM*) SvANY(sv))->xbm_rare
#define BmUSEFUL(sv) ((XPVBM*) SvANY(sv))->xbm_useful
#define BmPREVIOUS(sv) ((XPVBM*) SvANY(sv))->xbm_previous
/* shrink the sv if we allocated more than we used */
if (SvCUR(sv) + 5 < SvLEN(sv)) {
SvLEN_set(sv, SvCUR(sv) + 1);
- Renew(SvPVX(sv), SvLEN(sv), char);
+ SvPV_renew(sv, SvLEN(sv));
}
/* return the substring (via yylval) only if we parsed anything */
PL_multi_end = CopLINE(PL_curcop);
if (SvCUR(tmpstr) + 5 < SvLEN(tmpstr)) {
SvLEN_set(tmpstr, SvCUR(tmpstr) + 1);
- Renew(SvPVX(tmpstr), SvLEN(tmpstr), char);
+ SvPV_renew(tmpstr, SvLEN(tmpstr));
}
SvREFCNT_dec(herewas);
if (!IN_BYTES) {
/* if we allocated too much space, give some back */
if (SvCUR(sv) + 5 < SvLEN(sv)) {
SvLEN_set(sv, SvCUR(sv) + 1);
- Renew(SvPVX(sv), SvLEN(sv), char);
+ SvPV_renew(sv, SvLEN(sv));
}
/* decide whether this is the first or second quoted string we've read