summaryrefslogtreecommitdiff
path: root/mro.c
diff options
context:
space:
mode:
authorMarcus Holland-Moritz <mhx-perl@gmx.net>2008-01-04 01:06:10 +0000
committerMarcus Holland-Moritz <mhx-perl@gmx.net>2008-01-04 01:06:10 +0000
commit6e449a3ab1e3bd9d7e138ca681c733e57d4daa49 (patch)
treead260a44d03e2cd4466a3495bd249239dc834046 /mro.c
parentad25789c15269a04312e0efede81842547aa8212 (diff)
downloadperl-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.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/mro.c b/mro.c
index 9c57b79b7c..77112e1acd 100644
--- a/mro.c
+++ b/mro.c
@@ -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);
}
}