diff options
author | David Mitchell <davem@iabyn.com> | 2015-07-11 10:40:23 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2016-02-03 08:59:35 +0000 |
commit | 6e45d8466dd324149902764d87ad245baa32abb6 (patch) | |
tree | d3b96934379182aaf8238bed234f5d4a87dcb99c /proto.h | |
parent | 1312203610da7e0b5c8c8cf7747f48d67b22f988 (diff) | |
download | perl-6e45d8466dd324149902764d87ad245baa32abb6.tar.gz |
add Perl_clear_defarray()
This function implements the less commonly used branch in the POPSUB()
macro that clears @_ in place, or abandons it and creates a new array
in pad slot 0 of the function (the common branch is where @_ hasn't been
reified, and so can be clered simply by setting fill to -1).
By moving this out to a separate function we can avoid repeating the same
code everywhere the POPSUB macro is used; but since its only used
in the less frequent cases, the extra overall of a function call doesn't
matter.
It has a currently unused arg, 'abandon', which will be used shortly.
Diffstat (limited to 'proto.h')
-rw-r--r-- | proto.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -522,6 +522,9 @@ PERL_CALLCONV void Perl_ck_warner_d(pTHX_ U32 err, const char* pat, ...) PERL_CALLCONV bool Perl_ckwarn(pTHX_ U32 w); PERL_CALLCONV bool Perl_ckwarn_d(pTHX_ U32 w); +PERL_CALLCONV void Perl_clear_defarray(pTHX_ AV* av, bool abandon); +#define PERL_ARGS_ASSERT_CLEAR_DEFARRAY \ + assert(av) PERL_CALLCONV const COP* Perl_closest_cop(pTHX_ const COP *cop, const OP *o, const OP *curop, bool opnext); #define PERL_ARGS_ASSERT_CLOSEST_COP \ assert(cop) |