This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
clear_defarray(): clear @_ if possible
clear_defarray() is called during sub exit to clean up @_ in the
less common case where @_ has somehow gotten reified.
At the moment it just frees the old @_, then creates a new AV and
sticks it in pad[0].
This commit changes it so that for the reasonably common case of a reified
@_ where it's not magical and only has a reference count of 1, just call
av_clear() on it, rather than freeing and recreating.
Typical code that will benefit from this change is be something like:
sub f { push @_, ...; ... }
which causes the AV to be reified, but not to become otherwise visible.