diff options
author | Nicholas Clark <nick@ccl4.org> | 2010-02-10 09:57:23 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2010-05-24 15:50:57 +0100 |
commit | d5b1589c09b534ccfeb2eae26b3de9339c1bf22b (patch) | |
tree | 64fa4c03090b557d0687e9e3e845a62d74dc01fd /pad.c | |
parent | e42956688f2e0df936f1a42811962946e4e185bf (diff) | |
download | perl-d5b1589c09b534ccfeb2eae26b3de9339c1bf22b.tar.gz |
Convert PAD_DUP to a function Perl_padlist_dup().
assert() that pads are never AvREAL().
Diffstat (limited to 'pad.c')
-rw-r--r-- | pad.c | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -1752,6 +1752,31 @@ Perl_pad_compname_type(pTHX_ const PADOFFSET po) return NULL; } +#if defined(USE_ITHREADS) + +# define av_dup_inc(s,t) MUTABLE_AV(sv_dup_inc((const SV *)s,t)) + +AV * +Perl_padlist_dup(pTHX_ AV *const srcpad, CLONE_PARAMS *const param) +{ + AV *dstpad; + PERL_ARGS_ASSERT_PADLIST_DUP; + + if (!srcpad) + return NULL; + + assert(!AvREAL(srcpad)); + /* XXX padlists are real, but pretend to be not */ + AvREAL_on(srcpad); + dstpad = av_dup_inc(srcpad, param); + AvREAL_off(srcpad); + AvREAL_off(dstpad); + + return dstpad; +} + +#endif + /* * Local variables: * c-indentation-style: bsd |