Previously, @_ was allocated for every subroutine at compile time, with a
default sized AV, hence space for 4 entries. We don't actually need to
allocate the space for entries, as there is already a check at call time as to
whether @_ is long enough.
valgrind suggests that this saves allocating 23K (on a 64 bit platform) when
running pod2man on perlfunc.pod. As well as the absolute saving, there is also
benefit in deferring allocation for subroutines actually called - for a program
which forks, @_ is less likely to be in pages shared COW with the parent.
Resolves RT #72416.
*/
AV * const a0 = newAV(); /* will be @_ */
- av_extend(a0, 0);
av_store(pad, 0, MUTABLE_SV(a0));
AvREIFY_only(a0);
}
else if (type == padtidy_SUB) {
/* XXX DAPM this same bit of code keeps appearing !!! Rationalise? */
AV * const av = newAV(); /* Will be @_ */
- av_extend(av, 0);
av_store(PL_comppad, 0, MUTABLE_SV(av));
AvREIFY_only(av);
}
}
}
av = newAV();
- av_extend(av, 0);
av_store(newpad, 0, MUTABLE_SV(av));
AvREIFY_only(av);