aboutsummaryrefslogtreecommitdiffstats
path: root/URPM.xs
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2013-01-29 17:55:39 +0000
committerThierry Vignaud <tv@mageia.org>2013-01-29 17:55:39 +0000
commit4f3c5fb048666aeda7294cae8dabafa82f63f222 (patch)
tree87aaa38f64cc994691056c7d013692658ca56992 /URPM.xs
parent1b509f551f3b05a5a02120717cd4c1090bbdc295 (diff)
downloadperl-URPM-4f3c5fb048666aeda7294cae8dabafa82f63f222.tar
perl-URPM-4f3c5fb048666aeda7294cae8dabafa82f63f222.tar.gz
perl-URPM-4f3c5fb048666aeda7294cae8dabafa82f63f222.tar.bz2
perl-URPM-4f3c5fb048666aeda7294cae8dabafa82f63f222.tar.xz
perl-URPM-4f3c5fb048666aeda7294cae8dabafa82f63f222.zip
(call_package_callback,rpmRunTransactions_callback) optimize: preextend stack if needed
Diffstat (limited to 'URPM.xs')
-rw-r--r--URPM.xs18
1 files changed, 10 insertions, 8 deletions
diff --git a/URPM.xs b/URPM.xs
index e553153..624c6f1 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -994,8 +994,9 @@ call_package_callback(SV *urpm, SV *sv_pkg, SV *callback) {
/* now, a callback will be called for sure */
dSP;
PUSHMARK(SP);
- XPUSHs(urpm);
- XPUSHs(sv_pkg);
+ EXTEND(SP, 2);
+ PUSHs(urpm);
+ PUSHs(sv_pkg);
PUTBACK;
count = call_sv(callback, G_SCALAR);
SPAGAIN;
@@ -1279,13 +1280,14 @@ static void *rpmRunTransactions_callback(__attribute__((unused)) const void *h,
ENTER;
SAVETMPS;
PUSHMARK(SP);
- XPUSHs(td->data);
- mXPUSHs(newSVpv(callback_type, 0));
- XPUSHs(pkgKey != NULL ? sv_2mortal(newSViv((long)pkgKey - 1)) : &PL_sv_undef);
+ EXTEND(SP, callback_subtype == NULL ? 2 : 5);
+ PUSHs(td->data);
+ mPUSHs(newSVpv(callback_type, 0));
+ PUSHs(pkgKey != NULL ? sv_2mortal(newSViv((long)pkgKey - 1)) : &PL_sv_undef);
if (callback_subtype != NULL) {
- mXPUSHs(newSVpv(callback_subtype, 0));
- mXPUSHs(newSViv(amount));
- mXPUSHs(newSViv(total));
+ mPUSHs(newSVpv(callback_subtype, 0));
+ mPUSHs(newSViv(amount));
+ mPUSHs(newSViv(total));
}
PUTBACK;
i = call_sv(callback, callback == td->callback_open ? G_SCALAR : G_DISCARD);