diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-08-18 12:39:40 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-08-21 16:38:35 -0700 |
commit | 75e16a44f58a9b54834e043a988a36289179c4ab (patch) | |
tree | ad35a88c8217932de9e4f629278459cb0da6b778 /inline.h | |
parent | 27669aa412f62d9967b069ba672cd20239c354c1 (diff) | |
download | perl-75e16a44f58a9b54834e043a988a36289179c4ab.tar.gz |
Use fast SvREFCNT_dec for non-GCC
Diffstat (limited to 'inline.h')
-rw-r--r-- | inline.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -33,3 +33,15 @@ S_SvREFCNT_inc_void(SV *sv) if (sv) SvREFCNT(sv)++; } +PERL_STATIC_INLINE void +S_SvREFCNT_dec(pTHX_ SV *sv) +{ + if (sv) { + if (SvREFCNT(sv)) { + if (--(SvREFCNT(sv)) == 0) + Perl_sv_free2(aTHX_ sv); + } else { + sv_free(sv); + } + } +} |