summaryrefslogtreecommitdiff
path: root/proto.h
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2015-07-11 10:40:23 +0100
committerDavid Mitchell <davem@iabyn.com>2016-02-03 08:59:35 +0000
commit6e45d8466dd324149902764d87ad245baa32abb6 (patch)
treed3b96934379182aaf8238bed234f5d4a87dcb99c /proto.h
parent1312203610da7e0b5c8c8cf7747f48d67b22f988 (diff)
downloadperl-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.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/proto.h b/proto.h
index def673a25e..cef94b5b41 100644
--- a/proto.h
+++ b/proto.h
@@ -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)