PUSHMARK(SP);
EXTEND(SP,2);
PUSHs(SvTIED_obj((SV*)av, mg));
- PUSHs(sv_2mortal(newSViv(key+1)));
+ mPUSHi(key + 1);
PUTBACK;
call_method("EXTEND", G_SCALAR|G_DISCARD);
POPSTACK;
PUSHMARK(SP);
EXTEND(SP,2);
PUSHs(SvTIED_obj((SV*)av, mg));
- PUSHs(sv_2mortal(newSViv(fill+1)));
+ mPUSHi(fill + 1);
PUTBACK;
call_method("STORESIZE", G_SCALAR|G_DISCARD);
POPSTACK;
if (n > 1) {
if (mg->mg_ptr) {
if (mg->mg_len >= 0)
- PUSHs(newSVpvn_flags(mg->mg_ptr, mg->mg_len, SVs_TEMP));
+ mPUSHp(mg->mg_ptr, mg->mg_len);
else if (mg->mg_len == HEf_SVKEY)
PUSHs((SV*)mg->mg_ptr);
}
else if (mg->mg_type == PERL_MAGIC_tiedelem) {
- PUSHs(sv_2mortal(newSViv(mg->mg_len)));
+ mPUSHi(mg->mg_len);
}
}
if (n > 2) {
while((iter = hv_iternext(isarev)))
av_push(ret_array, newSVsv(hv_iterkeysv(iter)));
}
- XPUSHs(sv_2mortal(newRV_noinc((SV*)ret_array)));
+ mXPUSHs(newRV_noinc((SV*)ret_array));
PUTBACK;
return;
SP -= items;
- XPUSHs(sv_2mortal(newSViv(
- class_stash ? HvMROMETA(class_stash)->pkg_gen : 0
- )));
+ mXPUSHi(class_stash ? HvMROMETA(class_stash)->pkg_gen : 0);
PUTBACK;
return;
Perl_croak(aTHX_ "No next::method '%s' found for %s", subname, hvname);
XSRETURN_EMPTY;
}
- XPUSHs(sv_2mortal(newRV_inc(val)));
+ mXPUSHs(newRV_inc(val));
XSRETURN(1);
}
}
if (SvTYPE(candidate) == SVt_PVGV && (cand_cv = GvCV(candidate)) && !GvCVGEN(candidate)) {
SvREFCNT_inc_simple_void_NN((SV*)cand_cv);
(void)hv_store_ent(nmcache, newSVsv(sv), (SV*)cand_cv, 0);
- XPUSHs(sv_2mortal(newRV_inc((SV*)cand_cv)));
+ mXPUSHs(newRV_inc((SV*)cand_cv));
XSRETURN(1);
}
}
PUSHMARK(SP);
if (argv) {
while (*argv) {
- XPUSHs(sv_2mortal(newSVpv(*argv,0)));
+ mXPUSHs(newSVpv(*argv,0));
argv++;
}
PUTBACK;
const I32 items = SP - MARK;
SV * const av = (SV *) av_make(items, MARK+1);
SP = ORIGMARK; /* av_make() might realloc stack_sp */
- XPUSHs(sv_2mortal((PL_op->op_flags & OPf_SPECIAL)
- ? newRV_noinc(av) : av));
+ mXPUSHs((PL_op->op_flags & OPf_SPECIAL)
+ ? newRV_noinc(av) : av);
RETURN;
}
(void)hv_store_ent(hv,key,val,0);
}
SP = ORIGMARK;
- XPUSHs(sv_2mortal((PL_op->op_flags & OPf_SPECIAL)
- ? newRV_noinc((SV*) hv) : (SV*)hv));
+ mXPUSHs((PL_op->op_flags & OPf_SPECIAL)
+ ? newRV_noinc((SV*) hv) : (SV*) hv);
RETURN;
}
return lists from XSUB's - see C<mXPUSHu> instead. See also C<PUSHu> and
C<mPUSHu>.
+=for apidoc Am|void|mPUSHs|SV* sv
+Push an SV onto the stack and mortalizes the SV. The stack must have room
+for this element. Does not handle 'set' magic. Does not use C<TARG>.
+See also C<PUSHs> and C<mXPUSHs>.
+
=for apidoc Am|void|PUSHmortal
Push a new mortal SV onto the stack. The stack must have room for this
element. Does not handle 'set' magic. Does not use C<TARG>. See also
element. Handles 'set' magic. Does not use C<TARG>. See also C<PUSHu>,
C<mXPUSHu> and C<XPUSHu>.
+=for apidoc Am|void|mXPUSHs|SV* sv
+Push an SV onto the stack, extending the stack if necessary and mortalizes
+the SV. Does not handle 'set' magic. Does not use C<TARG>. See also
+C<XPUSHs> and C<mPUSHs>.
+
=for apidoc Am|void|XPUSHmortal
Push a new mortal SV onto the stack, extending the stack if necessary. Does
not handle 'set' magic. Does not use C<TARG>. See also C<XPUSHs>,
#define XPUSHu(u) STMT_START { sv_setuv(TARG, (UV)(u)); XPUSHTARG; } STMT_END
#define XPUSHundef STMT_START { SvOK_off(TARG); XPUSHs(TARG); } STMT_END
+#define mPUSHs(s) PUSHs(sv_2mortal(s))
#define PUSHmortal PUSHs(sv_newmortal())
#define mPUSHp(p,l) sv_setpvn_mg(PUSHmortal, (p), (l))
#define mPUSHn(n) sv_setnv_mg(PUSHmortal, (NV)(n))
#define mPUSHi(i) sv_setiv_mg(PUSHmortal, (IV)(i))
#define mPUSHu(u) sv_setuv_mg(PUSHmortal, (UV)(u))
+#define mXPUSHs(s) XPUSHs(sv_2mortal(s))
#define XPUSHmortal XPUSHs(sv_newmortal())
#define mXPUSHp(p,l) STMT_START { EXTEND(sp,1); sv_setpvn_mg(PUSHmortal, (p), (l)); } STMT_END
#define mXPUSHn(n) STMT_START { EXTEND(sp,1); sv_setnv_mg(PUSHmortal, (NV)(n)); } STMT_END
SvPV_set(dstr, NULL);
TAINT_IF(cx->sb_rxtainted & 1);
- PUSHs(sv_2mortal(newSViv(saviters - 1)));
+ mPUSHi(saviters - 1);
(void)SvPOK_only_UTF8(targ);
TAINT_IF(cx->sb_rxtainted);
if (PL_stack_base + *PL_markstack_ptr == SP) {
(void)POPMARK;
if (GIMME_V == G_SCALAR)
- XPUSHs(sv_2mortal(newSViv(0)));
+ mXPUSHi(0);
RETURNOP(PL_op->op_next->op_next);
}
PL_stack_sp = PL_stack_base + *PL_markstack_ptr + 1;
if (!stashname)
PUSHs(&PL_sv_undef);
else
- PUSHs(sv_2mortal(newSVpv(stashname, 0)));
- PUSHs(sv_2mortal(newSVpv(OutCopFILE(cx->blk_oldcop), 0)));
- PUSHs(sv_2mortal(newSViv((I32)CopLINE(cx->blk_oldcop))));
+ mPUSHs(newSVpv(stashname, 0));
+ mPUSHs(newSVpv(OutCopFILE(cx->blk_oldcop), 0));
+ mPUSHi((I32)CopLINE(cx->blk_oldcop));
if (!MAXARG)
RETURN;
if (CxTYPE(cx) == CXt_SUB || CxTYPE(cx) == CXt_FORMAT) {
if (isGV(cvgv)) {
SV * const sv = newSV(0);
gv_efullname3(sv, cvgv, NULL);
- PUSHs(sv_2mortal(sv));
- PUSHs(sv_2mortal(newSViv((I32)cx->blk_sub.hasargs)));
+ mPUSHs(sv);
+ mPUSHi((I32)cx->blk_sub.hasargs);
}
else {
PUSHs(newSVpvs_flags("(unknown)", SVs_TEMP));
- PUSHs(sv_2mortal(newSViv((I32)cx->blk_sub.hasargs)));
+ mPUSHi((I32)cx->blk_sub.hasargs);
}
}
else {
PUSHs(newSVpvs_flags("(eval)", SVs_TEMP));
- PUSHs(sv_2mortal(newSViv(0)));
+ mPUSHi(0);
}
gimme = (I32)cx->blk_gimme;
if (gimme == G_VOID)
PUSHs(&PL_sv_undef);
else
- PUSHs(sv_2mortal(newSViv(gimme & G_ARRAY)));
+ mPUSHi(gimme & G_ARRAY);
if (CxTYPE(cx) == CXt_EVAL) {
/* eval STRING */
if (cx->blk_eval.old_op_type == OP_ENTEREVAL) {
}
/* require */
else if (cx->blk_eval.old_namesv) {
- PUSHs(sv_2mortal(newSVsv(cx->blk_eval.old_namesv)));
+ mPUSHs(newSVsv(cx->blk_eval.old_namesv));
PUSHs(&PL_sv_yes);
}
/* eval BLOCK (try blocks have old_namesv == 0) */
/* XXX only hints propagated via op_private are currently
* visible (others are not easily accessible, since they
* use the global PL_hints) */
- PUSHs(sv_2mortal(newSViv(CopHINTS_get(cx->blk_oldcop))));
+ mPUSHi(CopHINTS_get(cx->blk_oldcop));
{
SV * mask ;
STRLEN * const old_warnings = cx->blk_oldcop->cop_warnings ;
}
else
mask = newSVpvn((char *) (old_warnings + 1), old_warnings[0]);
- PUSHs(sv_2mortal(mask));
+ mPUSHs(mask);
}
PUSHs(cx->blk_oldcop->cop_hints_hash ?
DEFSV = upstream;
PUSHMARK(SP);
- PUSHs(sv_2mortal(newSViv(0)));
+ mPUSHi(0);
if (filter_state) {
PUSHs(filter_state);
}
/* This is a const op added to hold the hints hash for
pp_entereval. The hash can be modified by the code
being eval'ed, so we return a copy instead. */
- XPUSHs(sv_2mortal((SV*)Perl_hv_copy_hints_hv(aTHX_ (HV*)cSVOP_sv)));
+ mXPUSHs((SV*)Perl_hv_copy_hints_hv(aTHX_ (HV*)cSVOP_sv));
else
/* Normal const. */
XPUSHs(cSVOP_sv);
}
TAINT_IF(rxtainted & 1);
SPAGAIN;
- PUSHs(sv_2mortal(newSViv((I32)iters)));
+ mPUSHi((I32)iters);
}
(void)SvPOK_only_UTF8(TARG);
TAINT_IF(rxtainted);
TAINT_IF(rxtainted & 1);
SPAGAIN;
- PUSHs(sv_2mortal(newSViv((I32)iters)));
+ mPUSHi((I32)iters);
(void)SvPOK_only(TARG);
if (doutf8)
sv = from <= s ?
newSVuv( u8 ? (UV) utf8_length((const U8*)from, (const U8*)s) : (UV) (s-from)) :
newSViv(-(u8 ? (IV) utf8_length((const U8*)s, (const U8*)from) : (IV) (from-s)));
- XPUSHs(sv_2mortal(sv));
+ mXPUSHs(sv);
break;
}
#ifdef PERL_PACK_CAN_SHRIEKSIGN
if (!(symptr->flags & FLAG_WAS_UTF8))
sv_utf8_downgrade(sv, 0);
}
- XPUSHs(sv_2mortal(sv));
+ mXPUSHs(sv);
s += len;
break;
case 'B':
if (aint >= 128 && datumtype != 'C') /* fake up signed chars */
aint -= 256;
if (!checksum)
- PUSHs(sv_2mortal(newSViv((IV)aint)));
+ mPUSHi(aint);
else if (checksum > bits_in_uv)
cdouble += (NV)aint;
else
Perl_croak(aTHX_ "Malformed UTF-8 string in unpack");
s += retlen;
if (!checksum)
- PUSHs(sv_2mortal(newSVuv((UV) val)));
+ mPUSHu(val);
else if (checksum > bits_in_uv)
cdouble += (NV) val;
else
} else if (!checksum)
while (len-- > 0) {
const U8 ch = *(U8 *) s++;
- PUSHs(sv_2mortal(newSVuv((UV) ch)));
+ mPUSHu(ch);
}
else if (checksum > bits_in_uv)
while (len-- > 0) cdouble += (NV) *(U8 *) s++;
s += retlen;
}
if (!checksum)
- PUSHs(sv_2mortal(newSVuv((UV) auv)));
+ mPUSHu(auv);
else if (checksum > bits_in_uv)
cdouble += (NV) auv;
else
SHIFT_VAR(utf8, s, strend, ashort, datumtype);
DO_BO_UNPACK(ashort, s);
if (!checksum)
- PUSHs(sv_2mortal(newSViv((IV)ashort)));
+ mPUSHi(ashort);
else if (checksum > bits_in_uv)
cdouble += (NV)ashort;
else
ai16 -= 65536;
#endif
if (!checksum)
- PUSHs(sv_2mortal(newSViv((IV)ai16)));
+ mPUSHi(ai16);
else if (checksum > bits_in_uv)
cdouble += (NV)ai16;
else
SHIFT_VAR(utf8, s, strend, aushort, datumtype);
DO_BO_UNPACK(aushort, s);
if (!checksum)
- PUSHs(sv_2mortal(newSVuv((UV) aushort)));
+ mPUSHu(aushort);
else if (checksum > bits_in_uv)
cdouble += (NV)aushort;
else
au16 = vtohs(au16);
#endif
if (!checksum)
- PUSHs(sv_2mortal(newSVuv((UV)au16)));
+ mPUSHu(au16);
else if (checksum > bits_in_uv)
cdouble += (NV) au16;
else
ai16 = (I16) vtohs((U16) ai16);
# endif /* HAS_VTOHS */
if (!checksum)
- PUSHs(sv_2mortal(newSViv((IV)ai16)));
+ mPUSHi(ai16);
else if (checksum > bits_in_uv)
cdouble += (NV) ai16;
else
SHIFT_VAR(utf8, s, strend, aint, datumtype);
DO_BO_UNPACK(aint, i);
if (!checksum)
- PUSHs(sv_2mortal(newSViv((IV)aint)));
+ mPUSHi(aint);
else if (checksum > bits_in_uv)
cdouble += (NV)aint;
else
SHIFT_VAR(utf8, s, strend, auint, datumtype);
DO_BO_UNPACK(auint, i);
if (!checksum)
- PUSHs(sv_2mortal(newSVuv((UV)auint)));
+ mPUSHu(auint);
else if (checksum > bits_in_uv)
cdouble += (NV)auint;
else
Perl_croak(aTHX_ "'j' not supported on this platform");
#endif
if (!checksum)
- PUSHs(sv_2mortal(newSViv(aiv)));
+ mPUSHi(aiv);
else if (checksum > bits_in_uv)
cdouble += (NV)aiv;
else
Perl_croak(aTHX_ "'J' not supported on this platform");
#endif
if (!checksum)
- PUSHs(sv_2mortal(newSVuv(auv)));
+ mPUSHu(auv);
else if (checksum > bits_in_uv)
cdouble += (NV)auv;
else
SHIFT_VAR(utf8, s, strend, along, datumtype);
DO_BO_UNPACK(along, l);
if (!checksum)
- PUSHs(sv_2mortal(newSViv((IV)along)));
+ mPUSHi(along);
else if (checksum > bits_in_uv)
cdouble += (NV)along;
else
if (ai32 > 2147483647) ai32 -= 4294967296;
#endif
if (!checksum)
- PUSHs(sv_2mortal(newSViv((IV)ai32)));
+ mPUSHi(ai32);
else if (checksum > bits_in_uv)
cdouble += (NV)ai32;
else
SHIFT_VAR(utf8, s, strend, aulong, datumtype);
DO_BO_UNPACK(aulong, l);
if (!checksum)
- PUSHs(sv_2mortal(newSVuv((UV)aulong)));
+ mPUSHu(aulong);
else if (checksum > bits_in_uv)
cdouble += (NV)aulong;
else
au32 = vtohl(au32);
#endif
if (!checksum)
- PUSHs(sv_2mortal(newSVuv((UV)au32)));
+ mPUSHu(au32);
else if (checksum > bits_in_uv)
cdouble += (NV)au32;
else
ai32 = (I32)vtohl((U32)ai32);
# endif
if (!checksum)
- PUSHs(sv_2mortal(newSViv((IV)ai32)));
+ mPUSHi(ai32);
else if (checksum > bits_in_uv)
cdouble += (NV)ai32;
else
SHIFT_VAR(utf8, s, strend, aptr, datumtype);
DO_BO_UNPACK_PC(aptr);
/* newSVpv generates undef if aptr is NULL */
- PUSHs(sv_2mortal(newSVpv(aptr, 0)));
+ mPUSHs(newSVpv(aptr, 0));
}
break;
case 'w':
/* UTF8_IS_XXXXX not right here - using constant 0x80 */
if (ch < 0x80) {
bytes = 0;
- PUSHs(sv_2mortal(newSVuv(auv)));
+ mPUSHu(auv);
len--;
auv = 0;
continue;
while (*t == '0')
t++;
sv_chop(sv, t);
- PUSHs(sv_2mortal(sv));
+ mPUSHs(sv);
len--;
auv = 0;
}
SHIFT_VAR(utf8, s, strend, aquad, datumtype);
DO_BO_UNPACK(aquad, 64);
if (!checksum)
- PUSHs(sv_2mortal(aquad >= IV_MIN && aquad <= IV_MAX ?
- newSViv((IV)aquad) : newSVnv((NV)aquad)));
+ mPUSHs(aquad >= IV_MIN && aquad <= IV_MAX ?
+ newSViv((IV)aquad) : newSVnv((NV)aquad));
else if (checksum > bits_in_uv)
cdouble += (NV)aquad;
else
SHIFT_VAR(utf8, s, strend, auquad, datumtype);
DO_BO_UNPACK(auquad, 64);
if (!checksum)
- PUSHs(sv_2mortal(auquad <= UV_MAX ?
- newSVuv((UV)auquad):newSVnv((NV)auquad)));
+ mPUSHs(auquad <= UV_MAX ?
+ newSVuv((UV)auquad) : newSVnv((NV)auquad));
else if (checksum > bits_in_uv)
cdouble += (NV)auquad;
else
SHIFT_VAR(utf8, s, strend, afloat, datumtype);
DO_BO_UNPACK_N(afloat, float);
if (!checksum)
- PUSHs(sv_2mortal(newSVnv((NV)afloat)));
+ mPUSHn(afloat);
else
cdouble += afloat;
}
SHIFT_VAR(utf8, s, strend, adouble, datumtype);
DO_BO_UNPACK_N(adouble, double);
if (!checksum)
- PUSHs(sv_2mortal(newSVnv((NV)adouble)));
+ mPUSHn(adouble);
else
cdouble += adouble;
}
SHIFT_VAR(utf8, s, strend, anv, datumtype);
DO_BO_UNPACK_N(anv, NV);
if (!checksum)
- PUSHs(sv_2mortal(newSVnv(anv)));
+ mPUSHn(anv);
else
cdouble += anv;
}
SHIFT_VAR(utf8, s, strend, aldouble, datumtype);
DO_BO_UNPACK_N(aldouble, long double);
if (!checksum)
- PUSHs(sv_2mortal(newSVnv((NV)aldouble)));
+ mPUSHn(aldouble);
else
cdouble += aldouble;
}
}
sv = newSVuv(cuv);
}
- XPUSHs(sv_2mortal(sv));
+ mXPUSHs(sv);
checksum = 0;
}
SvREFCNT_dec(sv);
break;
}
- XPUSHs(sv_2mortal(sv));
+ mXPUSHs(sv);
if (SvLEN(sv) - SvCUR(sv) > 20) {
SvPV_shrink_to_cur(sv);
}
if (gv && isGV(gv) && (cv = GvCV(gv))) {
PUSHMARK(SP);
XPUSHs(SvTIED_obj((SV*)gv, mg));
- XPUSHs(sv_2mortal(newSViv(SvREFCNT(obj)-1)));
+ mXPUSHi(SvREFCNT(obj) - 1);
PUTBACK;
ENTER;
call_sv((SV *)cv, G_VOID);
PUSHs(sv);
PUSHs(left);
if (SvIV(right))
- PUSHs(sv_2mortal(newSVuv(O_RDWR|O_CREAT)));
+ mPUSHu(O_RDWR|O_CREAT);
else
- PUSHs(sv_2mortal(newSVuv(O_RDWR)));
+ mPUSHu(O_RDWR);
PUSHs(right);
PUTBACK;
call_sv((SV*)GvCV(gv), G_SCALAR);
PUSHMARK(SP);
PUSHs(sv);
PUSHs(left);
- PUSHs(sv_2mortal(newSVuv(O_RDONLY)));
+ mPUSHu(O_RDONLY);
PUSHs(right);
PUTBACK;
call_sv((SV*)GvCV(gv), G_SCALAR);
if (GIMME == G_ARRAY && tbuf) {
value = (NV)(timebuf.tv_sec) +
(NV)(timebuf.tv_usec) / 1000000.0;
- PUSHs(sv_2mortal(newSVnv(value)));
+ mPUSHn(value);
}
RETURN;
#else
XPUSHTARG;
}
else {
- XPUSHs(sv_2mortal(newRV((SV*)egv)));
+ mXPUSHs(newRV((SV*)egv));
}
}
PUSHMARK(SP);
XPUSHs(SvTIED_obj((SV*)io, mg));
#if LSEEKSIZE > IVSIZE
- XPUSHs(sv_2mortal(newSVnv((NV) offset)));
+ mXPUSHn((NV) offset);
#else
- XPUSHs(sv_2mortal(newSViv(offset)));
+ mXPUSHi(offset);
#endif
- XPUSHs(sv_2mortal(newSViv(whence)));
+ mXPUSHi(whence);
PUTBACK;
ENTER;
call_method("SEEK", G_SCALAR);
newSViv(sought)
#endif
: newSVpvn(zero_but_true, ZBTLEN);
- PUSHs(sv_2mortal(sv));
+ mPUSHs(sv);
}
}
RETURN;
if (max) {
EXTEND(SP, max);
EXTEND_MORTAL(max);
- PUSHs(sv_2mortal(newSViv(PL_statcache.st_dev)));
- PUSHs(sv_2mortal(newSViv(PL_statcache.st_ino)));
- PUSHs(sv_2mortal(newSVuv(PL_statcache.st_mode)));
- PUSHs(sv_2mortal(newSVuv(PL_statcache.st_nlink)));
+ mPUSHi(PL_statcache.st_dev);
+ mPUSHi(PL_statcache.st_ino);
+ mPUSHu(PL_statcache.st_mode);
+ mPUSHu(PL_statcache.st_nlink);
#if Uid_t_size > IVSIZE
- PUSHs(sv_2mortal(newSVnv(PL_statcache.st_uid)));
+ mPUSHn(PL_statcache.st_uid);
#else
# if Uid_t_sign <= 0
- PUSHs(sv_2mortal(newSViv(PL_statcache.st_uid)));
+ mPUSHi(PL_statcache.st_uid);
# else
- PUSHs(sv_2mortal(newSVuv(PL_statcache.st_uid)));
+ mPUSHu(PL_statcache.st_uid);
# endif
#endif
#if Gid_t_size > IVSIZE
- PUSHs(sv_2mortal(newSVnv(PL_statcache.st_gid)));
+ mPUSHn(PL_statcache.st_gid);
#else
# if Gid_t_sign <= 0
- PUSHs(sv_2mortal(newSViv(PL_statcache.st_gid)));
+ mPUSHi(PL_statcache.st_gid);
# else
- PUSHs(sv_2mortal(newSVuv(PL_statcache.st_gid)));
+ mPUSHu(PL_statcache.st_gid);
# endif
#endif
#ifdef USE_STAT_RDEV
- PUSHs(sv_2mortal(newSViv(PL_statcache.st_rdev)));
+ mPUSHi(PL_statcache.st_rdev);
#else
PUSHs(newSVpvs_flags("", SVs_TEMP));
#endif
#if Off_t_size > IVSIZE
- PUSHs(sv_2mortal(newSVnv((NV)PL_statcache.st_size)));
+ mPUSHn(PL_statcache.st_size);
#else
- PUSHs(sv_2mortal(newSViv(PL_statcache.st_size)));
+ mPUSHi(PL_statcache.st_size);
#endif
#ifdef BIG_TIME
- PUSHs(sv_2mortal(newSVnv(PL_statcache.st_atime)));
- PUSHs(sv_2mortal(newSVnv(PL_statcache.st_mtime)));
- PUSHs(sv_2mortal(newSVnv(PL_statcache.st_ctime)));
+ mPUSHn(PL_statcache.st_atime);
+ mPUSHn(PL_statcache.st_mtime);
+ mPUSHn(PL_statcache.st_ctime);
#else
- PUSHs(sv_2mortal(newSViv((IV)PL_statcache.st_atime)));
- PUSHs(sv_2mortal(newSViv((IV)PL_statcache.st_mtime)));
- PUSHs(sv_2mortal(newSViv((IV)PL_statcache.st_ctime)));
+ mPUSHi(PL_statcache.st_atime);
+ mPUSHi(PL_statcache.st_mtime);
+ mPUSHi(PL_statcache.st_ctime);
#endif
#ifdef USE_STAT_BLOCKS
- PUSHs(sv_2mortal(newSVuv(PL_statcache.st_blksize)));
- PUSHs(sv_2mortal(newSVuv(PL_statcache.st_blocks)));
+ mPUSHu(PL_statcache.st_blksize);
+ mPUSHu(PL_statcache.st_blocks);
#else
PUSHs(newSVpvs_flags("", SVs_TEMP));
PUSHs(newSVpvs_flags("", SVs_TEMP));
if (!(IoFLAGS(io) & IOf_UNTAINT))
SvTAINTED_on(sv);
#endif
- XPUSHs(sv_2mortal(sv));
+ mXPUSHs(sv);
} while (gimme == G_ARRAY);
if (!dp && gimme != G_ARRAY)
/* is returned. */
#endif
- PUSHs(sv_2mortal(newSVnv(((NV)PL_timesbuf.tms_utime)/(NV)PL_clocktick)));
+ mPUSHn(((NV)PL_timesbuf.tms_utime)/(NV)PL_clocktick);
if (GIMME == G_ARRAY) {
- PUSHs(sv_2mortal(newSVnv(((NV)PL_timesbuf.tms_stime)/(NV)PL_clocktick)));
- PUSHs(sv_2mortal(newSVnv(((NV)PL_timesbuf.tms_cutime)/(NV)PL_clocktick)));
- PUSHs(sv_2mortal(newSVnv(((NV)PL_timesbuf.tms_cstime)/(NV)PL_clocktick)));
+ mPUSHn(((NV)PL_timesbuf.tms_stime)/(NV)PL_clocktick);
+ mPUSHn(((NV)PL_timesbuf.tms_cutime)/(NV)PL_clocktick);
+ mPUSHn(((NV)PL_timesbuf.tms_cstime)/(NV)PL_clocktick);
}
RETURN;
#else
# ifdef PERL_MICRO
dSP;
- PUSHs(sv_2mortal(newSVnv((NV)0.0)));
+ mPUSHn(0.0);
EXTEND(SP, 4);
if (GIMME == G_ARRAY) {
- PUSHs(sv_2mortal(newSVnv((NV)0.0)));
- PUSHs(sv_2mortal(newSVnv((NV)0.0)));
- PUSHs(sv_2mortal(newSVnv((NV)0.0)));
+ mPUSHn(0.0);
+ mPUSHn(0.0);
+ mPUSHn(0.0);
}
RETURN;
# else
tmbuf->tm_min,
tmbuf->tm_sec,
tmbuf->tm_year + 1900);
- PUSHs(sv_2mortal(tsv));
+ mPUSHs(tsv);
}
else if (tmbuf) {
EXTEND(SP, 9);
EXTEND_MORTAL(9);
- PUSHs(sv_2mortal(newSViv(tmbuf->tm_sec)));
- PUSHs(sv_2mortal(newSViv(tmbuf->tm_min)));
- PUSHs(sv_2mortal(newSViv(tmbuf->tm_hour)));
- PUSHs(sv_2mortal(newSViv(tmbuf->tm_mday)));
- PUSHs(sv_2mortal(newSViv(tmbuf->tm_mon)));
- PUSHs(sv_2mortal(newSViv(tmbuf->tm_year)));
- PUSHs(sv_2mortal(newSViv(tmbuf->tm_wday)));
- PUSHs(sv_2mortal(newSViv(tmbuf->tm_yday)));
- PUSHs(sv_2mortal(newSViv(tmbuf->tm_isdst)));
+ mPUSHi(tmbuf->tm_sec);
+ mPUSHi(tmbuf->tm_min);
+ mPUSHi(tmbuf->tm_hour);
+ mPUSHi(tmbuf->tm_mday);
+ mPUSHi(tmbuf->tm_mon);
+ mPUSHi(tmbuf->tm_year);
+ mPUSHi(tmbuf->tm_wday);
+ mPUSHi(tmbuf->tm_yday);
+ mPUSHi(tmbuf->tm_isdst);
}
RETURN;
}
}
if (hent) {
- PUSHs(sv_2mortal(newSVpv((char*)hent->h_name, 0)));
+ mPUSHs(newSVpv((char*)hent->h_name, 0));
PUSHs(space_join_names_mortal(hent->h_aliases));
- PUSHs(sv_2mortal(newSViv((IV)hent->h_addrtype)));
+ mPUSHi(hent->h_addrtype);
len = hent->h_length;
- PUSHs(sv_2mortal(newSViv((IV)len)));
+ mPUSHi(len);
#ifdef h_addr
for (elem = hent->h_addr_list; elem && *elem; elem++) {
- XPUSHs(newSVpvn_flags(*elem, len, SVs_TEMP));
+ mXPUSHp(*elem, len);
}
#else
if (hent->h_addr)
}
if (nent) {
- PUSHs(sv_2mortal(newSVpv(nent->n_name, 0)));
+ mPUSHs(newSVpv(nent->n_name, 0));
PUSHs(space_join_names_mortal(nent->n_aliases));
- PUSHs(sv_2mortal(newSViv((IV)nent->n_addrtype)));
- PUSHs(sv_2mortal(newSViv((IV)nent->n_net)));
+ mPUSHi(nent->n_addrtype);
+ mPUSHi(nent->n_net);
}
RETURN;
}
if (pent) {
- PUSHs(sv_2mortal(newSVpv(pent->p_name, 0)));
+ mPUSHs(newSVpv(pent->p_name, 0));
PUSHs(space_join_names_mortal(pent->p_aliases));
- PUSHs(sv_2mortal(newSViv((IV)pent->p_proto)));
+ mPUSHi(pent->p_proto);
}
RETURN;
}
if (sent) {
- PUSHs(sv_2mortal(newSVpv(sent->s_name, 0)));
+ mPUSHs(newSVpv(sent->s_name, 0));
PUSHs(space_join_names_mortal(sent->s_aliases));
#ifdef HAS_NTOHS
- PUSHs(sv_2mortal(newSViv((IV)PerlSock_ntohs(sent->s_port))));
+ mPUSHi(PerlSock_ntohs(sent->s_port));
#else
- PUSHs(sv_2mortal(newSViv((IV)(sent->s_port))));
+ mPUSHi(sent->s_port);
#endif
- PUSHs(sv_2mortal(newSVpv(sent->s_proto, 0)));
+ mPUSHs(newSVpv(sent->s_proto, 0));
}
RETURN;
}
if (pwent) {
- PUSHs(sv_2mortal(newSVpv(pwent->pw_name, 0)));
+ mPUSHs(newSVpv(pwent->pw_name, 0));
- PUSHs(sv = sv_2mortal(newSViv(0)));
+ sv = newSViv(0);
+ mPUSHs(sv);
/* If we have getspnam(), we try to dig up the shadow
* password. If we are underprivileged, the shadow
* interface will set the errno to EACCES or similar,
# endif
# if Uid_t_sign <= 0
- PUSHs(sv_2mortal(newSViv((IV)pwent->pw_uid)));
+ mPUSHi(pwent->pw_uid);
# else
- PUSHs(sv_2mortal(newSVuv((UV)pwent->pw_uid)));
+ mPUSHu(pwent->pw_uid);
# endif
# if Uid_t_sign <= 0
- PUSHs(sv_2mortal(newSViv((IV)pwent->pw_gid)));
+ mPUSHi(pwent->pw_gid);
# else
- PUSHs(sv_2mortal(newSVuv((UV)pwent->pw_gid)));
+ mPUSHu(pwent->pw_gid);
# endif
/* pw_change, pw_quota, and pw_age are mutually exclusive--
* because of the poor interface of the Perl getpw*(),
* A better interface would have been to return a hash,
* but we are accursed by our history, alas. --jhi. */
# ifdef PWCHANGE
- PUSHs(sv_2mortal(newSViv((IV)pwent->pw_change)));
+ mPUSHi(pwent->pw_change);
# else
# ifdef PWQUOTA
- PUSHs(sv_2mortal(newSViv((IV)pwent->pw_quota)));
+ mPUSHi(pwent->pw_quota);
# else
# ifdef PWAGE
- PUSHs(sv_2mortal(newSVpv(pwent->pw_age, 0)));
+ mPUSHs(newSVpv(pwent->pw_age, 0));
# else
/* I think that you can never get this compiled, but just in case. */
PUSHs(sv_mortalcopy(&PL_sv_no));
/* pw_class and pw_comment are mutually exclusive--.
* see the above note for pw_change, pw_quota, and pw_age. */
# ifdef PWCLASS
- PUSHs(sv_2mortal(newSVpv(pwent->pw_class, 0)));
+ mPUSHs(newSVpv(pwent->pw_class, 0));
# else
# ifdef PWCOMMENT
- PUSHs(sv_2mortal(newSVpv(pwent->pw_comment, 0)));
+ mPUSHs(newSVpv(pwent->pw_comment, 0));
# else
/* I think that you can never get this compiled, but just in case. */
PUSHs(sv_mortalcopy(&PL_sv_no));
SvTAINTED_on(sv);
# endif
- PUSHs(sv_2mortal(newSVpv(pwent->pw_dir, 0)));
+ mPUSHs(newSVpv(pwent->pw_dir, 0));
PUSHs(sv = sv_2mortal(newSVpv(pwent->pw_shell, 0)));
# ifndef INCOMPLETE_TAINTS
# endif
# ifdef PWEXPIRE
- PUSHs(sv_2mortal(newSViv((IV)pwent->pw_expire)));
+ mPUSHi(pwent->pw_expire);
# endif
}
RETURN;
}
if (grent) {
- PUSHs(sv_2mortal(newSVpv(grent->gr_name, 0)));
+ mPUSHs(newSVpv(grent->gr_name, 0));
#ifdef GRPASSWD
- PUSHs(sv_2mortal(newSVpv(grent->gr_passwd, 0)));
+ mPUSHs(newSVpv(grent->gr_passwd, 0));
#else
PUSHs(sv_mortalcopy(&PL_sv_no));
#endif
- PUSHs(sv_2mortal(newSViv((IV)grent->gr_gid)));
+ mPUSHi(grent->gr_gid);
#if !(defined(_CRAYMPP) && defined(USE_REENTRANT_API))
/* In UNICOS/mk (_CRAYMPP) the multithreading
ENTER;
SAVETMPS;
PUSHMARK(SP);
- XPUSHs(sv_2mortal(newSVhek(hvname)));
+ mXPUSHs(newSVhek(hvname));
PUTBACK;
call_sv((SV*)GvCV(cloner), G_SCALAR);
SPAGAIN;
ENTER;
SAVETMPS;
PUSHMARK(SP);
- XPUSHs(sv_2mortal(newSVhek(HvNAME_HEK(stash))));
+ mXPUSHs(newSVhek(HvNAME_HEK(stash)));
PUTBACK;
call_sv((SV*)GvCV(cloner), G_DISCARD);
FREETMPS;
XPUSHs(encoding);
XPUSHs(dsv);
XPUSHs(ssv);
- XPUSHs(offsv = sv_2mortal(newSViv(*offset)));
- XPUSHs(newSVpvn_flags(tstr, tlen, SVs_TEMP));
+ offsv = newSViv(*offset);
+ mXPUSHs(offsv);
+ mXPUSHp(tstr, tlen);
PUTBACK;
call_method("cat_decode", G_SCALAR);
SPAGAIN;
PUSHMARK(SP);
XPUSHs(sv);
- XPUSHs(sv_2mortal(newSVpv(name, 0)));
+ mXPUSHs(newSVpv(name, 0));
PUTBACK;
methodname = newSVpvs_flags("isa", SVs_TEMP);
if ( strcmp(classname,"version") != 0 ) /* inherited new() */
sv_bless(rv, gv_stashpv(classname, GV_ADD));
- PUSHs(sv_2mortal(rv));
+ mPUSHs(rv);
PUTBACK;
return;
}
else
Perl_croak(aTHX_ "lobj is not of type version");
- PUSHs(sv_2mortal(vstringify(lobj)));
+ mPUSHs(vstringify(lobj));
PUTBACK;
return;
else
Perl_croak(aTHX_ "lobj is not of type version");
- PUSHs(sv_2mortal(vnumify(lobj)));
+ mPUSHs(vnumify(lobj));
PUTBACK;
return;
else
Perl_croak(aTHX_ "lobj is not of type version");
- PUSHs(sv_2mortal(vnormal(lobj)));
+ mPUSHs(vnormal(lobj));
PUTBACK;
return;
rs = newSViv(vcmp(lobj,rvs));
}
- PUSHs(sv_2mortal(rs));
+ mPUSHs(rs);
}
PUTBACK;
if (sv_derived_from(ST(0), "version")) {
SV * const lobj = SvRV(ST(0));
SV * const rs = newSViv( vcmp(lobj,new_version(newSVpvs("0"))) );
- PUSHs(sv_2mortal(rs));
+ mPUSHs(rs);
PUTBACK;
return;
}
}
else
{
- PUSHs(sv_2mortal(new_version(ver)));
+ mPUSHs(new_version(ver));
}
PUTBACK;
if (items != 0)
Perl_croak(aTHX_ "Usage: Tie::Hash::NamedCapture::flags()");
- XPUSHs(sv_2mortal(newSVuv(RXapif_ONE)));
- XPUSHs(sv_2mortal(newSVuv(RXapif_ALL)));
+ mXPUSHu(RXapif_ONE);
+ mXPUSHu(RXapif_ALL);
PUTBACK;
return;
}
SPAGAIN;
PUSHMARK(SP);
EXTEND(SP,5);
- PUSHs(newSVpvn_flags(pkg, pkg_len, SVs_TEMP));
- PUSHs(newSVpvn_flags(name, name_len, SVs_TEMP));
+ mPUSHp(pkg, pkg_len);
+ mPUSHp(name, name_len);
PUSHs(listsv);
- PUSHs(sv_2mortal(newSViv(minbits)));
- PUSHs(sv_2mortal(newSViv(none)));
+ mPUSHi(minbits);
+ mPUSHi(none);
PUTBACK;
errsv_save = newSVsv(ERRSV);
if (call_method("SWASHNEW", G_SCALAR))
PUSHMARK(SP);
EXTEND(SP,2);
PUSHs(SvTIED_obj((SV*)io, mg));
- PUSHs(newSVpvn_flags(message, msglen, SVs_TEMP));
+ mPUSHp(message, msglen);
PUTBACK;
call_method("PRINT", G_SCALAR);