diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-06-08 14:54:21 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-06-08 14:54:21 +0000 |
commit | 8e09340b6ffe3c6ffbac698cf506650fc1e43293 (patch) | |
tree | ce7885b36d26fb3a13f47abfe1d268ef71460df3 /cop.h | |
parent | 3ddcf04c0ce8e80ebac79bbf5bc3ba56e0756b06 (diff) | |
download | perl-8e09340b6ffe3c6ffbac698cf506650fc1e43293.tar.gz |
be more optimal about clearing @_
p4raw-id: //depot/perl@6216
Diffstat (limited to 'cop.h')
-rw-r--r-- | cop.h | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -107,8 +107,13 @@ struct block_sub { #endif /* USE_THREADS */ /* junk in @_ spells trouble when cloning CVs and in pp_caller(), so don't - * leave any */ -#define CLEAR_ARGARRAY() av_clear(cx->blk_sub.argarray) + * leave any (a fast av_clear(ary), basically) */ +#define CLEAR_ARGARRAY(ary) \ + STMT_START { \ + AvMAX(ary) += AvARRAY(ary) - AvALLOC(ary); \ + SvPVX(ary) = (char*)AvALLOC(ary); \ + AvFILLp(ary) = -1; \ + } STMT_END #define POPSUB(cx,sv) \ STMT_START { \ @@ -124,7 +129,7 @@ struct block_sub { PL_curpad[0] = (SV*)cx->blk_sub.argarray; \ } \ else { \ - CLEAR_ARGARRAY(); \ + CLEAR_ARGARRAY(cx->blk_sub.argarray); \ } \ } \ sv = (SV*)cx->blk_sub.cv; \ |