diff options
author | Paul "LeoNerd" Evans <leonerd@leonerd.org.uk> | 2021-08-22 19:42:15 +0100 |
---|---|---|
committer | Paul Evans <leonerd@leonerd.org.uk> | 2021-08-25 19:57:49 +0100 |
commit | 11d028376675b37f3e9c5f15bc93ab00562a25d1 (patch) | |
tree | bd771b42ae3ba25ec964246c376e0dfa8ed61825 | |
parent | 7c2d42a7fc929320cd3f6fa97291ee8853fab689 (diff) | |
download | perl-11d028376675b37f3e9c5f15bc93ab00562a25d1.tar.gz |
Add sv_setrv_inc()
-rw-r--r-- | embed.fnc | 1 | ||||
-rw-r--r-- | embed.h | 1 | ||||
-rw-r--r-- | proto.h | 3 | ||||
-rw-r--r-- | sv.c | 16 |
4 files changed, 21 insertions, 0 deletions
@@ -1926,6 +1926,7 @@ Apd |void |sv_setpvn |NN SV *const sv|NULLOK const char *const ptr|const STRLEN Apd |char *|sv_setpv_bufsize|NN SV *const sv|const STRLEN cur|const STRLEN len Xp |void |sv_sethek |NN SV *const sv|NULLOK const HEK *const hek Apd |void |sv_setrv_noinc |NN SV *const sv|NN SV *const ref +Apd |void |sv_setrv_inc |NN SV *const sv|NN SV *const ref ApMdb |void |sv_setsv |NN SV *dsv|NULLOK SV *ssv CpMdb |void |sv_taint |NN SV* sv CpdR |bool |sv_tainted |NN SV *const sv @@ -695,6 +695,7 @@ #define sv_setref_pv(a,b,c) Perl_sv_setref_pv(aTHX_ a,b,c) #define sv_setref_pvn(a,b,c,d) Perl_sv_setref_pvn(aTHX_ a,b,c,d) #define sv_setref_uv(a,b,c) Perl_sv_setref_uv(aTHX_ a,b,c) +#define sv_setrv_inc(a,b) Perl_sv_setrv_inc(aTHX_ a,b) #define sv_setrv_noinc(a,b) Perl_sv_setrv_noinc(aTHX_ a,b) #define sv_setsv_flags(a,b,c) Perl_sv_setsv_flags(aTHX_ a,b,c) #define sv_setsv_mg(a,b) Perl_sv_setsv_mg(aTHX_ a,b) @@ -3814,6 +3814,9 @@ PERL_CALLCONV SV* Perl_sv_setref_pvn(pTHX_ SV *const rv, const char *const class PERL_CALLCONV SV* Perl_sv_setref_uv(pTHX_ SV *const rv, const char *const classname, const UV uv); #define PERL_ARGS_ASSERT_SV_SETREF_UV \ assert(rv) +PERL_CALLCONV void Perl_sv_setrv_inc(pTHX_ SV *const sv, SV *const ref); +#define PERL_ARGS_ASSERT_SV_SETRV_INC \ + assert(sv); assert(ref) PERL_CALLCONV void Perl_sv_setrv_noinc(pTHX_ SV *const sv, SV *const ref); #define PERL_ARGS_ASSERT_SV_SETRV_NOINC \ assert(sv); assert(ref) @@ -1810,6 +1810,22 @@ Perl_sv_setrv_noinc(pTHX_ SV *const sv, SV *const ref) SvROK_on(sv); } +/* +=for apidoc sv_setrv_inc + +As C<sv_setrv_noinc> but increments the reference count of I<ref>. + +=cut +*/ + +void +Perl_sv_setrv_inc(pTHX_ SV *const sv, SV *const ref) +{ + PERL_ARGS_ASSERT_SV_SETRV_INC; + + sv_setrv_noinc(sv, SvREFCNT_inc_simple_NN(ref)); +} + /* Return a cleaned-up, printable version of sv, for non-numeric, or * not incrementable warning display. * Originally part of S_not_a_number(). |