diff options
author | Marcus Holland-Moritz <mhx-perl@gmx.net> | 2008-01-04 01:06:10 +0000 |
---|---|---|
committer | Marcus Holland-Moritz <mhx-perl@gmx.net> | 2008-01-04 01:06:10 +0000 |
commit | 6e449a3ab1e3bd9d7e138ca681c733e57d4daa49 (patch) | |
tree | ad260a44d03e2cd4466a3495bd249239dc834046 /mro.c | |
parent | ad25789c15269a04312e0efede81842547aa8212 (diff) | |
download | perl-6e449a3ab1e3bd9d7e138ca681c733e57d4daa49.tar.gz |
Add macros mPUSHs() and mXPUSHs() for pushing SVs on the stack
and mortalizing them. Use these macros where possible. And also
mX?PUSH[inpu] where possible.
p4raw-id: //depot/perl@32821
Diffstat (limited to 'mro.c')
-rw-r--r-- | mro.c | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -822,7 +822,7 @@ XS(XS_mro_get_isarev) 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; @@ -912,9 +912,7 @@ XS(XS_mro_get_pkg_gen) 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; @@ -1041,7 +1039,7 @@ XS(XS_mro_nextcan) 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); } } @@ -1102,7 +1100,7 @@ XS(XS_mro_nextcan) 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); } } |