diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-09-06 00:51:16 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-09-06 06:18:08 -0700 |
commit | 199f858d54d30a550be7320e065420353bca5318 (patch) | |
tree | d59886518fdbd5c6bb873ebe8e54526cb45f521f /sv.c | |
parent | dd2a7f9048da2c440a4dfed5122c0bfd98f079d3 (diff) | |
download | perl-199f858d54d30a550be7320e065420353bca5318.tar.gz |
Put AV defelem creation code in one place
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -9661,6 +9661,19 @@ Perl_newSVrv(pTHX_ SV *const rv, const char *const classname) return sv; } +SV * +Perl_newSVavdefelem(pTHX_ AV *av, SSize_t ix, bool extendible) +{ + SV * const lv = newSV_type(SVt_PVLV); + PERL_ARGS_ASSERT_NEWSVAVDEFELEM; + LvTYPE(lv) = 'y'; + sv_magic(lv, NULL, PERL_MAGIC_defelem, NULL, 0); + LvTARG(lv) = SvREFCNT_inc_simple_NN(av); + LvSTARGOFF(lv) = ix; + LvTARGLEN(lv) = extendible ? 1 : (STRLEN)UV_MAX; + return lv; +} + /* =for apidoc sv_setref_pv |