aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-06-13 18:44:15 +0000
committerThierry Vignaud <tv@mageia.org>2012-06-13 18:44:15 +0000
commit1869caccae3a2edd6cceb75e92e471169f0c6b64 (patch)
tree103ffbd417a7d23afff1960b6e91718ccf29ad43
parent788837fec9ad925d0fa777fd853635a5faec4a66 (diff)
downloadperl-URPM-1869caccae3a2edd6cceb75e92e471169f0c6b64.tar
perl-URPM-1869caccae3a2edd6cceb75e92e471169f0c6b64.tar.gz
perl-URPM-1869caccae3a2edd6cceb75e92e471169f0c6b64.tar.bz2
perl-URPM-1869caccae3a2edd6cceb75e92e471169f0c6b64.tar.xz
perl-URPM-1869caccae3a2edd6cceb75e92e471169f0c6b64.zip
(return_list_tag) preallocate the stack
-rw-r--r--URPM.xs9
1 files changed, 6 insertions, 3 deletions
diff --git a/URPM.xs b/URPM.xs
index e573f21..19457b0 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -488,8 +488,9 @@ return_list_uint_16(const Header header, rpmTag tag_name) {
int count = rpmtdCount(&list);
int i;
uint16_t *list_ = list.data;
+ EXTEND(SP, count);
for(i = 0; i < count; i++) {
- mXPUSHs(newSViv(list_[i]));
+ mPUSHs(newSViv(list_[i]));
}
rpmtdFreeData(&list);
}
@@ -554,8 +555,9 @@ return_list_tag(const URPM__Package pkg, rpmTag tag_name) {
{
int i;
int *r = (int *)list;
+ EXTEND(SP, count);
for (i=0; i < count; i++) {
- mXPUSHs(newSViv(r[i]));
+ mPUSHs(newSViv(r[i]));
}
}
break;
@@ -568,8 +570,9 @@ return_list_tag(const URPM__Package pkg, rpmTag tag_name) {
{
int i;
char **s = (char **)list;
+ EXTEND(SP, count);
for (i = 0; i < count; i++)
- mXPUSHs(newSVpv(s[i], 0));
+ mPUSHs(newSVpv(s[i], 0));
}
break;
case RPM_I18NSTRING_TYPE: